RCommon.EFCore
2.3.2-alpha.0.2
This is a prerelease version of RCommon.EFCore.
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package RCommon.EFCore --version 2.3.2-alpha.0.2
NuGet\Install-Package RCommon.EFCore -Version 2.3.2-alpha.0.2
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="RCommon.EFCore" Version="2.3.2-alpha.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RCommon.EFCore" Version="2.3.2-alpha.0.2" />
<PackageReference Include="RCommon.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 RCommon.EFCore --version 2.3.2-alpha.0.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: RCommon.EFCore, 2.3.2-alpha.0.2"
#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 RCommon.EFCore@2.3.2-alpha.0.2
#: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=RCommon.EFCore&version=2.3.2-alpha.0.2&prerelease
#tool nuget:?package=RCommon.EFCore&version=2.3.2-alpha.0.2&prerelease
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
RCommon.EFCore
Entity Framework Core implementation of the RCommon persistence abstractions. Provides a fully-featured repository with LINQ queries, eager loading, change tracking, and automatic domain event integration -- all backed by EF Core's DbContext.
Features
EFCoreRepository<TEntity>implementingIGraphRepository<T>,ILinqRepository<T>,IReadOnlyRepository<T>, andIWriteOnlyRepository<T>- Full
IQueryable<T>support for composable LINQ queries at the domain layer - Eager loading via
Include/ThenIncludemapped to EF Core'sIIncludableQueryable - Configurable change tracking (enable/disable per repository via the
Trackingproperty) - Paginated query results with ordering support
- Bulk delete via
ExecuteDeleteAsyncfor expression-based batch operations - Named data store support for multi-database scenarios through
IDataStoreFactory RCommonDbContextbase class implementingIDataStorefor seamless factory resolution- Fluent DI configuration to register DbContexts as named data stores
- Automatic entity event tracking for domain event dispatching on add, update, and delete
- Targets .NET 8, .NET 9, and .NET 10
Installation
dotnet add package RCommon.EFCore
Usage
// Configure in Program.cs or Startup
builder.Services.AddRCommon()
.WithPersistence<EFCorePerisistenceBuilder>(ef =>
{
ef.AddDbContext<ApplicationDbContext>("ApplicationDb", options =>
options.UseSqlServer(builder.Configuration.GetConnectionString("ApplicationDb")));
ef.SetDefaultDataStore(defaults =>
defaults.DefaultDataStoreName = "ApplicationDb");
});
Your DbContext must inherit from RCommonDbContext:
public class ApplicationDbContext : RCommonDbContext
{
public ApplicationDbContext(DbContextOptions<ApplicationDbContext> options)
: base(options) { }
public DbSet<Order> Orders => Set<Order>();
public DbSet<Customer> Customers => Set<Customer>();
}
Then inject and use the repository abstractions:
public class OrderService
{
private readonly IGraphRepository<Order> _orderRepo;
public OrderService(IGraphRepository<Order> orderRepo)
{
_orderRepo = orderRepo;
}
public async Task<ICollection<Order>> GetCustomerOrdersAsync(int customerId)
{
_orderRepo.Include(o => o.LineItems);
return await _orderRepo.FindAsync(o => o.CustomerId == customerId);
}
}
Key Types
| Type | Description |
|---|---|
EFCoreRepository<TEntity> |
Concrete repository backed by EF Core with full CRUD, LINQ, eager loading, and change tracking |
RCommonDbContext |
Abstract DbContext base class implementing IDataStore for named data store resolution |
EFCorePerisistenceBuilder |
Fluent builder for registering EF Core DbContexts and repository services in DI |
IEFCorePersistenceBuilder |
Builder interface exposing AddDbContext<T>() for registering named DbContexts |
Documentation
For full documentation, visit rcommon.com.
Related Packages
- RCommon.Persistence - Core persistence abstractions (required dependency)
- RCommon.Dapper - Dapper implementation
- RCommon.Linq2Db - Linq2Db implementation
License
Licensed under the Apache License, Version 2.0.
| 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 is compatible. 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.2)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.2)
- RCommon.Core (>= 2.3.2-alpha.0.2)
- RCommon.Persistence (>= 2.3.2-alpha.0.2)
-
net8.0
- Microsoft.EntityFrameworkCore (>= 8.0.16)
- Microsoft.EntityFrameworkCore.Relational (>= 8.0.16)
- RCommon.Core (>= 2.3.2-alpha.0.2)
- RCommon.Persistence (>= 2.3.2-alpha.0.2)
-
net9.0
- Microsoft.EntityFrameworkCore (>= 9.0.10)
- Microsoft.EntityFrameworkCore.Relational (>= 9.0.10)
- RCommon.Core (>= 2.3.2-alpha.0.2)
- RCommon.Persistence (>= 2.3.2-alpha.0.2)
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 |
|---|---|---|
| 3.1.0-alpha.3 | 37 | 5/18/2026 |
| 2.4.2-alpha.0.10 | 69 | 4/5/2026 |
| 2.4.2-alpha.0.9 | 58 | 3/26/2026 |
| 2.4.2-alpha.0.8 | 56 | 3/26/2026 |
| 2.4.2-alpha.0.7 | 55 | 3/26/2026 |
| 2.4.2-alpha.0.6 | 61 | 3/25/2026 |
| 2.4.2-alpha.0.5 | 56 | 3/24/2026 |
| 2.4.2-alpha.0.1 | 57 | 3/24/2026 |
| 2.4.1 | 122 | 2/18/2026 |
| 2.3.2-alpha.0.3 | 65 | 2/18/2026 |
| 2.3.2-alpha.0.2 | 65 | 2/18/2026 |
| 2.3.2-alpha.0.1 | 74 | 2/9/2026 |
| 2.3.1 | 180 | 2/5/2026 |
| 2.3.0 | 112 | 2/3/2026 |
| 2.2.2-alpha.0.1 | 404 | 12/11/2025 |
| 2.2.1-alpha.0.2 | 145 | 10/24/2025 |
| 2.2.1-alpha.0.1 | 152 | 10/24/2025 |
| 2.1.11-alpha.0.2 | 149 | 10/24/2025 |
| 2.1.11-alpha.0.1 | 127 | 7/18/2025 |
| 2.1.10 | 301 | 7/17/2025 |
Loading failed