DbFactoryAdapter 1.0.4

dotnet add package DbFactoryAdapter --version 1.0.4
NuGet\Install-Package DbFactoryAdapter -Version 1.0.4
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="DbFactoryAdapter" Version="1.0.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add DbFactoryAdapter --version 1.0.4
#r "nuget: DbFactoryAdapter, 1.0.4"
#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 DbFactoryAdapter as a Cake Addin
#addin nuget:?package=DbFactoryAdapter&version=1.0.4

// Install DbFactoryAdapter as a Cake Tool
#tool nuget:?package=DbFactoryAdapter&version=1.0.4

DbConnectAdapter

Dbfactory adapter middleware, supports

  1. Oracle
  2. MS Sql Server
  3. Postgres
  4. MySql

public class DatabaseBase { public IDbContext DbContext; }

public class Database : DatabaseBase { public Database(IConfiguration config, IHost host) { Initialize(config, host); }

    private void Initialize(IConfiguration config, IHost host)
    {
        IConnection conn = new Connection();
        config.GetSection("Connection").Bind(conn);
        DbContext = ActivatorUtilities.CreateInstance<DbContext>(host.Services, conn);
    }

}

appsettings.json file:

''' "Connection": { "DatabaseType": "SQLSERVER", "Server": "0.0.0.0", "DatabaseName": "database", "UserId": "sa", "Password": "***", "Port": 1443, "MaxPoolSize": 0, "ConnectionTimeout": 60, "CommandTimeout": 0 } '''

program.cs file:

''' builder.Services.AddTransient<IConnection, Connection>(); builder.Services.AddTransient<IDbContext, DbContext>(); builder.Services.AddTransient<Database>(); IConfigurationSection ConnectionSection = builder.Configuration.GetSection("Connection"); builder.Services.Configure<IConnection>(ConnectionSection); '''

USESAGE:

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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. 
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.4 552 12/3/2023
1.0.3 119 11/30/2023
1.0.2 112 11/28/2023
1.0.1 131 11/23/2023
1.0.0 126 11/20/2023