Simplify.EntityFramework
1.2.0
dotnet add package Simplify.EntityFramework --version 1.2.0
NuGet\Install-Package Simplify.EntityFramework -Version 1.2.0
<PackageReference Include="Simplify.EntityFramework" Version="1.2.0" />
<PackageVersion Include="Simplify.EntityFramework" Version="1.2.0" />
<PackageReference Include="Simplify.EntityFramework" />
paket add Simplify.EntityFramework --version 1.2.0
#r "nuget: Simplify.EntityFramework, 1.2.0"
#:package Simplify.EntityFramework@1.2.0
#addin nuget:?package=Simplify.EntityFramework&version=1.2.0
#tool nuget:?package=Simplify.EntityFramework&version=1.2.0
Simplify.EntityFramework Documentation
Simplifies Entity Framework Core connection configuration by building SQL Server connection strings from Simplify-style database connection settings.
Available at NuGet as binary package
Database Connection Settings
The DatabaseConnectionSettings configuration section describes the database connection:
{
"DatabaseConnectionSettings": {
"ServerName": "localhost",
"DataBaseName": "MyDatabase",
"UserName": "sa",
"UserPassword": "password",
"ShowSql": "false",
"Port": "1433"
}
}
ServerName, DataBaseName, and UserName are required — a missing value throws DatabaseConnectionConfigurationException. UserPassword, ShowSql, and Port are optional.
These are mapped to the DbConnectionSettings class:
public class DbConnectionSettings
{
public string ServerName { get; protected set; }
public string DataBaseName { get; protected set; }
public string UserName { get; protected set; }
public string UserPassword { get; protected set; }
public bool ShowSql { get; protected set; }
public int? Port { get; protected set; }
}
ConfigurationBasedDbConnectionSettings is an IConfiguration-based implementation that loads and validates these values from a configuration section.
Building a Connection String
SettingsBasedConnectionString builds a SQL Server connection string from the settings:
// Builds the connection string from a configuration section (default section: "DatabaseConnectionSettings").
public static string Build(IConfiguration configuration, string configSectionName = "DatabaseConnectionSettings");
// Builds the connection string from a DbConnectionSettings instance.
public static string Build(DbConnectionSettings settings);
Usage Example
public class MyDbContext(IConfiguration configuration) : DbContext
{
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
var connectionString = SettingsBasedConnectionString.Build(configuration);
optionsBuilder.UseSqlServer(connectionString);
}
}
Exceptions
// Thrown when the database connection configuration is missing or incomplete.
public sealed class DatabaseConnectionConfigurationException : Exception;
// General Simplify.EntityFramework related exception.
public class SimplifyEntityFrameworkException : Exception;
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- Microsoft.Data.SqlClient (>= 6.1.2)
- Microsoft.EntityFrameworkCore (>= 9.0.9)
- Microsoft.Extensions.Configuration.Abstractions (>= 9.0.9)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Simplify.EntityFramework:
| Package | Downloads |
|---|---|
|
Simplify.Repository.EntityFramework
Simplify.Repository EntityFramework implementation |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.2.0 | 52 | 8/18/2026 |
| 1.1.0 | 236 | 10/11/2025 |
| 1.0.0 | 752 | 1/14/2024 |
| 1.0.0-pre03 | 294 | 4/26/2023 |
| 1.0.0-pre02 | 1,103 | 11/11/2022 |
| 1.0.0-pre01 | 542 | 1/24/2022 |