AddDynamicDbContext 1.0.0
dotnet add package AddDynamicDbContext --version 1.0.0
NuGet\Install-Package AddDynamicDbContext -Version 1.0.0
<PackageReference Include="AddDynamicDbContext" Version="1.0.0" />
paket add AddDynamicDbContext --version 1.0.0
#r "nuget: AddDynamicDbContext, 1.0.0"
// Install AddDynamicDbContext as a Cake Addin #addin nuget:?package=AddDynamicDbContext&version=1.0.0 // Install AddDynamicDbContext as a Cake Tool #tool nuget:?package=AddDynamicDbContext&version=1.0.0
This extension aims to simplify ConnectionString definition for Development and Production environments when adding DbContext to our .Net Core project.
You can use this plugin when adding DbContext to services in Startup. ConnectionString to be used when accessing your database will be determined automatically according to your environment.
It is simple to use, we call the AddDDbContext
extension when adding dbcontext in the Startup.cs ConfigureServices
method.
services.AddDDbContext<SampleDbContext>("Sample");
We add our Development and Production environment information to the ConnectionStrings section of our appsettings.json
file.
"ConnectionStrings": {
"Sample": {
"Development": "Development ConnectionString",
"Production": "Production ConnectionString"
}
}
Parameters
Descriptions and default values for the extension parameters.
connectionStringKey
ConnectionString key at the appsettins.json file.provider
Select the type of provider to use when connecting. You can choose [SqlServer or MySQLServer].debug
Use the Production environment while in Debug mode.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.2 is compatible. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
-
.NETCoreApp 2.2
- Microsoft.EntityFrameworkCore (>= 2.2.0)
- Microsoft.EntityFrameworkCore.SqlServer (>= 2.2.0)
- Microsoft.Extensions.Configuration (>= 2.2.0)
- Microsoft.Extensions.Configuration.Abstractions (>= 2.2.0)
- Microsoft.Extensions.Configuration.FileExtensions (>= 2.2.0)
- Microsoft.Extensions.Configuration.Json (>= 2.2.0)
- MySql.Data.EntityFrameworkCore (>= 8.0.18)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 795 | 3/28/2020 |