EFCore_DaInLoader 10.0.11.10924

dotnet add package EFCore_DaInLoader --version 10.0.11.10924
                    
NuGet\Install-Package EFCore_DaInLoader -Version 10.0.11.10924
                    
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="EFCore_DaInLoader" Version="10.0.11.10924" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="EFCore_DaInLoader" Version="10.0.11.10924" />
                    
Directory.Packages.props
<PackageReference Include="EFCore_DaInLoader" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add EFCore_DaInLoader --version 10.0.11.10924
                    
#r "nuget: EFCore_DaInLoader, 10.0.11.10924"
                    
#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.
#:package EFCore_DaInLoader@10.0.11.10924
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=EFCore_DaInLoader&version=10.0.11.10924
                    
Install as a Cake Addin
#tool nuget:?package=EFCore_DaInLoader&version=10.0.11.10924
                    
Install as a Cake Tool

EFCore Database Independence

Load EF Core database providers as plugins instead of taking a compile-time dependency on every provider.

Packages

  • EFCore_DaIn targets netstandard2.0 and contains the shared IDatabasePlugin contract.
  • EFCore_DaIn_10 targets net10.0, contains the EF Core 10 plugin contracts and EfCorePluginLoader_10, and depends on EFCore_DaIn.

The provider implementations in this repository are built separately for SQLite, PostgreSQL, SQL Server, and MongoDB. They are plugin assemblies, not dependencies that must be referenced by the host application.

Load plugins from the published provider index

ProvidersIndexLoaders reads providers.json, selects entries for the current OS runtime, downloads each provider ZIP, and extracts it below AppContext.BaseDirectory\plugins.

using EFCoreLoader;
using EFCore_DaIn_10;

var indexLoader = new ProvidersIndexLoaders("https://ignatandrei.github.io/");
var index = await indexLoader.LoadFromUrlAsync();

foreach (var version in index?.VersionsEFCore() ?? [])
{
    foreach (var runtime in index.LoadProviders(version))
    {
        var providerDirectory = Path.Combine(
            AppContext.BaseDirectory,
            "plugins",
            version.ToString(),
            runtime.Name!);

        var extractedDirectory = Path.Combine(providerDirectory, runtime.Rid!);
        if (!Directory.Exists(extractedDirectory))
        {
            await indexLoader.SaveProviderFromUrl(runtime, version);
        }
    }
}

var assemblies = EfCorePluginLoader_10.DiscoverPluginAssemblies(
    Path.Combine(AppContext.BaseDirectory, "plugins"));

foreach (var assemblyPath in assemblies)
{
    foreach (var plugin in EfCorePluginLoader_10.LoadFromAssembly(assemblyPath))
    {
        Console.WriteLine($"{plugin.ProviderName}: {plugin.Description}");
    }
}

The index URL must expose EFCore_DatabaseIndependence/providers10.0.11/providers.json and the ZIP paths listed by that JSON. The current loader chooses win-x64, linux-x64, or osx-x64.

Load plugins already on disk

If provider ZIPs have already been extracted, no network access is required. The expected directory layout is:

plugins\
  10.0.11\
    DainEF.Providers.Sqlite\
      win-x64\
        DainEF.Providers.Sqlite.dll

Discover and load the assemblies directly:

var assemblies = EfCorePluginLoader_10.DiscoverPluginAssemblies(
    @"D:\my-app\plugins",
    runtimeFolderName: "win-x64");

foreach (var assemblyPath in assemblies)
{
    var plugins = EfCorePluginLoader_10.LoadFromAssembly(
        assemblyPath,
        isUnloadable: false);
}

For a single known DLL, call LoadFromAssembly with its full path. CreateLoader is available when the host needs to control the PluginLoader lifetime.

Configure a DbContext

Each loaded plugin implements IEFCore_DatabasePlugin_10:

var options = plugin
    .GenerateDbContextOptionsBuilder<MyDbContext>(connectionString, "MyDatabase")
    .Options;

await using var db = new MyDbContext(options);

Alternatively, apply the provider to an existing options builder with plugin.UsePlugin(...).

Build and publish

From the repository root:

dotnet pack .\src\EFCore_DaIn\EFCore_DaIn\EFCore_DaIn.csproj -c Release -o .\artifacts\packages
dotnet pack .\src\EFCore_DaIn\10.0.11\EFCore_DaIn_10\EFCore_DaIn_10.csproj -c Release -o .\artifacts\packages
dotnet nuget push .\artifacts\packages\EFCore_DaIn.10.0.11.nupkg --api-key $env:NUGET_API_KEY --source https://api.nuget.org/v3/index.json
dotnet nuget push .\artifacts\packages\EFCore_DaIn_10.10.0.11.nupkg --api-key $env:NUGET_API_KEY --source https://api.nuget.org/v3/index.json

Use a NuGet API key with push permission, and publish EFCore_DaIn before EFCore_DaIn_10 because the latter references the former.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

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
10.0.11.10924 121 9/27/2026
10.0.11.10923 95 9/22/2026