AddDynamicDbContext 1.0.0

dotnet add package AddDynamicDbContext --version 1.0.0
NuGet\Install-Package AddDynamicDbContext -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="AddDynamicDbContext" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add AddDynamicDbContext --version 1.0.0
#r "nuget: AddDynamicDbContext, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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 726 3/28/2020