Ploch.Data.EFCore 4.0.1

dotnet add package Ploch.Data.EFCore --version 4.0.1
                    
NuGet\Install-Package Ploch.Data.EFCore -Version 4.0.1
                    
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="Ploch.Data.EFCore" Version="4.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Ploch.Data.EFCore" Version="4.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Ploch.Data.EFCore" />
                    
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 Ploch.Data.EFCore --version 4.0.1
                    
#r "nuget: Ploch.Data.EFCore, 4.0.1"
                    
#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 Ploch.Data.EFCore@4.0.1
                    
#: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=Ploch.Data.EFCore&version=4.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Ploch.Data.EFCore&version=4.0.1
                    
Install as a Cake Tool

Ploch.Data.EFCore

Core EF Core utilities for the Ploch.Data libraries -- design-time DbContext factory base classes, configurators, data seeding, and value converters.

Key Features

  • BaseDbContextFactory<TDbContext, TFactory> -- abstract base for design-time factories with automatic migrations assembly configuration
  • IDbContextConfigurator -- abstraction for runtime DbContext configuration (used in DI and integration tests)
  • ConnectionString -- helper to read connection strings from appsettings.json
  • DataSeeder -- utilities for seeding data into the database
  • CollectionStringSplitConverter -- EF Core value converter for storing string collections as delimited strings

Installation

<PackageReference Include="Ploch.Data.EFCore" />

For most applications, use one of the provider-specific packages instead:

  • Ploch.Data.EFCore.SqLite
  • Ploch.Data.EFCore.SqlServer

Quick Start

using Ploch.Data.EFCore;

// Create a design-time factory by inheriting from a provider-specific base
public class MyDbContextFactory : BaseDbContextFactory<MyDbContext, MyDbContextFactory>
{
    public MyDbContextFactory() : base(options => new MyDbContext(options)) { }

    protected override DbContextOptionsBuilder<MyDbContext> ConfigureOptions(
        Func<string> connectionStringFunc,
        DbContextOptionsBuilder<MyDbContext> optionsBuilder)
    {
        return optionsBuilder.UseSqlite(
            connectionStringFunc(), ApplyMigrationsAssembly);
    }
}

Documentation

See the Data Project Setup Guide for step-by-step instructions and the Architecture Overview for package details.

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.  net9.0 was computed.  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 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.

NuGet packages (5)

Showing the top 5 NuGet packages that depend on Ploch.Data.EFCore:

Package Downloads
Ploch.Data.EFCore.SqLite

Generic Repository, Unit of Work and Data Utilities

Ploch.Data.EFCore.IntegrationTesting

Generic Repository, Unit of Work and Data Utilities

Ploch.Data.EFCore.SqlServer

Generic Repository, Unit of Work and Data Utilities

Ploch.Data.GenericRepository.EFCore

Generic repository for Entity Framework Core

Ploch.Data.GenericRepository.EFCore.SqlServer

Generic Repository, Unit of Work and Data Utilities

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.1 115 9/10/2026
2.1.0 280 11/3/2024