Rwx.Persistence.EfCore
0.3.1
dotnet add package Rwx.Persistence.EfCore --version 0.3.1
NuGet\Install-Package Rwx.Persistence.EfCore -Version 0.3.1
<PackageReference Include="Rwx.Persistence.EfCore" Version="0.3.1" />
<PackageVersion Include="Rwx.Persistence.EfCore" Version="0.3.1" />
<PackageReference Include="Rwx.Persistence.EfCore" />
paket add Rwx.Persistence.EfCore --version 0.3.1
#r "nuget: Rwx.Persistence.EfCore, 0.3.1"
#:package Rwx.Persistence.EfCore@0.3.1
#addin nuget:?package=Rwx.Persistence.EfCore&version=0.3.1
#tool nuget:?package=Rwx.Persistence.EfCore&version=0.3.1
Rwx.Persistence.EfCore
Entity Framework Core repositories, unit of work, auditing/domain-event interceptors, durable integration-event inbox, and shared model-building helpers.
Install
dotnet add package Rwx.Persistence.EfCore --version 0.1.0
Quick start
Register your context and bind repositories to that specific context:
using Microsoft.EntityFrameworkCore;
using Rwx.Persistence.EfCore;
using Rwx.Persistence.EfCore.Interceptors;
builder.Services.AddRwxAuditing();
builder.Services.AddDbContext<AppDbContext>((provider, options) =>
options.UseNpgsql(connectionString)
.AddInterceptors(
provider.GetRequiredService<AuditableEntityInterceptor>(),
provider.GetRequiredService<DomainEventsInterceptor>()));
builder.Services.AddRwxRepository<AppDbContext>();
builder.Services.AddRwxUnitOfWork<AppDbContext>();
builder.Services.AddRwxInbox();
In OnModelCreating, explicitly apply the Rwx-owned configuration when using the durable inbox:
modelBuilder.ApplyConfiguration(new InboxMessageConfiguration());
AddRwxRepository<TDbContext>() is recommended: it scans public DbSet<TEntity> properties and avoids ambiguity in services with multiple contexts. AddRwxRepository() is suitable only for a single-context service.
Call ApplyRwxSoftDeleteQueryFilter() after entity configurations to exclude soft-deleted entities. Contexts implementing IRwxTenantDbContext can also call ApplyRwxOrgQueryFilter(this) for organization scoping.
Required composition rules
Every aggregate-persisting context must register both Rwx interceptors shown above. Apply InboxMessageConfiguration and call AddRwxInbox() only when consuming messages needs durable deduplication. EF configuration belongs to the consuming service's DbContext; this package never creates or applies migrations. Repositories and unit of work are scoped and must share the same context/transaction.
| Product | Versions 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. |
-
net10.0
- FluentValidation (>= 12.1.1)
- FluentValidation.DependencyInjectionExtensions (>= 12.1.0)
- Microsoft.EntityFrameworkCore (>= 10.0.9)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.9)
- Microsoft.Extensions.Configuration.Abstractions (>= 10.0.9)
- Microsoft.Extensions.DependencyInjection (>= 10.0.9)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.9)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.9)
- Microsoft.Extensions.Logging (>= 10.0.9)
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.9)
- Rwx.Application (>= 0.3.1)
- Rwx.Core (>= 0.3.1)
- Rwx.Domain (>= 0.3.1)
- Rwx.EventBus.Abstractions (>= 0.3.1)
- Rwx.Security (>= 0.3.1)
- Rwx.UnitOfWork (>= 0.3.1)
- Scrutor (>= 7.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.