Ploch.Data.GenericRepository.EFCore
4.0.1
dotnet add package Ploch.Data.GenericRepository.EFCore --version 4.0.1
NuGet\Install-Package Ploch.Data.GenericRepository.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.GenericRepository.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.GenericRepository.EFCore" Version="4.0.1" />
<PackageReference Include="Ploch.Data.GenericRepository.EFCore" />
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.GenericRepository.EFCore --version 4.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Ploch.Data.GenericRepository.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.GenericRepository.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.GenericRepository.EFCore&version=4.0.1
#tool nuget:?package=Ploch.Data.GenericRepository.EFCore&version=4.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Ploch.Data.GenericRepository.EFCore
Entity Framework Core implementations of the Generic Repository and Unit of Work patterns defined in Ploch.Data.GenericRepository.
Key Features
- Full repository implementations --
ReadRepositoryAsync<TEntity, TId>,ReadWriteRepositoryAsync<TEntity, TId>,QueryableRepository<TEntity> - Unit of Work --
UnitOfWork<TDbContext>withCommitAsyncandRollbackAsync - DI registration --
AddRepositories<TDbContext>()registers all interfaces with a single call - Custom repository support --
AddCustomReadWriteAsyncRepositoryfor domain-specific repositories - Audit entity handler --
AuditEntityHandlerfor automatic timestamp and user tracking - Eager loading --
onDbSetparameter forInclude/ThenIncludeon read operations
Installation
<PackageReference Include="Ploch.Data.GenericRepository.EFCore" />
Quick Start
For most applications, use one of the provider-specific packages instead of this package directly:
Ploch.Data.GenericRepository.EFCore.SqLite-- SQLitePloch.Data.GenericRepository.EFCore.SqlServer-- SQL Server
// Recommended: use a provider-specific package for one-call registration
using Ploch.Data.GenericRepository.EFCore.DependencyInjection;
builder.Services.AddDbContextWithRepositories<MyDbContext>();
// Alternative: manual registration with this package
services.AddDbContext<MyDbContext>(options => options.UseSqlite(connectionString));
services.AddRepositories<MyDbContext>();
// Use repositories
public class MyService(IReadWriteRepositoryAsync<Product, int> repo)
{
public async Task CreateAsync(Product product)
{
await repo.AddAsync(product);
}
public async Task<Product?> GetWithDetailsAsync(int id)
{
return await repo.GetByIdAsync(id,
onDbSet: q => q.Include(p => p.Category).Include(p => p.Tags));
}
}
Documentation
- Dependency Injection Guide -- all DI registration approaches, provider switching, and lifecycle plugins
- Generic Repository Guide -- all read/write operations, Unit of Work patterns, specifications, and error handling
| Product | Versions 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.
-
net10.0
- Microsoft.EntityFrameworkCore (>= 10.0.5)
- Microsoft.EntityFrameworkCore.Abstractions (>= 10.0.5)
- Microsoft.Extensions.Configuration (>= 10.0.5)
- Microsoft.Extensions.Options (>= 10.0.5)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.5)
- Ploch.Common.AppServices (>= 4.0.47)
- Ploch.Common.DependencyInjection (>= 4.0.47)
- Ploch.Data.EFCore (>= 4.0.1)
- Ploch.Data.GenericRepository (>= 4.0.1)
-
net8.0
- Microsoft.EntityFrameworkCore (>= 8.0.25)
- Microsoft.EntityFrameworkCore.Abstractions (>= 8.0.25)
- Microsoft.Extensions.Configuration (>= 10.0.5)
- Microsoft.Extensions.Options (>= 10.0.5)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.5)
- Ploch.Common.AppServices (>= 4.0.47)
- Ploch.Common.DependencyInjection (>= 4.0.47)
- Ploch.Data.EFCore (>= 4.0.1)
- Ploch.Data.GenericRepository (>= 4.0.1)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Ploch.Data.GenericRepository.EFCore:
| Package | Downloads |
|---|---|
|
Ploch.Data.GenericRepository.EFCore.IntegrationTesting
Generic Repository, Unit of Work and Data Utilities |
|
|
Ploch.Data.GenericRepository.EFCore.SqlServer
Generic Repository, Unit of Work and Data Utilities |
|
|
Ploch.Data.GenericRepository.EFCore.SqLite
Generic Repository, Unit of Work and Data Utilities |
GitHub repositories
This package is not used by any popular GitHub repositories.