Kck.Persistence.Abstractions
3.4.0
dotnet add package Kck.Persistence.Abstractions --version 3.4.0
NuGet\Install-Package Kck.Persistence.Abstractions -Version 3.4.0
<PackageReference Include="Kck.Persistence.Abstractions" Version="3.4.0" />
<PackageVersion Include="Kck.Persistence.Abstractions" Version="3.4.0" />
<PackageReference Include="Kck.Persistence.Abstractions" />
paket add Kck.Persistence.Abstractions --version 3.4.0
#r "nuget: Kck.Persistence.Abstractions, 3.4.0"
#:package Kck.Persistence.Abstractions@3.4.0
#addin nuget:?package=Kck.Persistence.Abstractions&version=3.4.0
#tool nuget:?package=Kck.Persistence.Abstractions&version=3.4.0
Kck.Persistence.Abstractions
Repository and Unit-of-Work persistence abstractions following the Specification pattern — IReadRepository<T,TId>, IWriteRepository<T,TId>, dynamic filtering, and IUnitOfWork.
Installation
dotnet add package Kck.Persistence.Abstractions
Quick Start
// Program.cs — register the Entity Framework provider
builder.Services.AddKckEntityFramework<AppDbContext>(builder.Configuration);
// Use repositories in handlers
public class GetOrderHandler(IReadRepository<Order, Guid> orders)
{
public async Task<Order?> HandleAsync(Guid orderId, CancellationToken ct)
=> await orders.GetByIdAsync(orderId, ct);
}
public class CreateOrderHandler(
IWriteRepository<Order, Guid> orders, IUnitOfWork uow)
{
public async Task<Order> HandleAsync(CreateOrderCommand cmd, CancellationToken ct)
{
var order = Order.Create(cmd.CustomerName, cmd.Total);
await orders.AddAsync(order, ct);
await uow.SaveChangesAsync(ct);
return order;
}
}
// Dynamic query with QueryOptions
var activeOrders = await orders.ListAsync(
new QueryOptions<Order>
{
Filter = o => o.Status == OrderStatus.Active,
OrderBy = q => q.OrderByDescending(o => o.CreatedAt),
AsTracking = false
}, ct);
Configuration
| Property | Description | Default |
|---|---|---|
Persistence:ConnectionString |
Database connection string | — |
Persistence:CommandTimeout |
EF command timeout (seconds) | 30 |
Persistence:EnableSensitiveDataLogging |
Log parameter values | false |
Resources
| 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
- Kck.Core.Abstractions (>= 3.4.0)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on Kck.Persistence.Abstractions:
| Package | Downloads |
|---|---|
|
Kck.Bundle.WebApi
Opinionated ASP.NET Core WebAPI starter pack. Registers Serilog, in-memory caching, JWT auth, Argon2 hashing, InMemory event bus, OpenTelemetry, rate limiting, security headers, CORS, and global exception handling in a single AddKckWebApiDefaults() call. |
|
|
Kck.Persistence.EntityFramework
Entity Framework Core implementations of IReadRepository<T,TId>, IWriteRepository<T,TId>, and IUnitOfWork. Includes AuditInterceptor (auto CreatedDate/ModifiedDate), DynamicFilterExtensions, soft-delete support, and ToPaginateAsync extension. Registered via AddKckEntityFramework<TContext>(). |
|
|
Kck.Pipeline.MediatR
MediatR-backed pipeline behaviors for Kck. Provides Authorization, Caching, Logging, Transaction, and Validation behaviors. DEPRECATED — use Kck.Pipeline.Mediator instead. Will be removed in a future version (KCK0200). |
|
|
Kck.Pipeline.Mediator
Mediator.Abstractions 3.x-backed pipeline behaviors for Kck. Provides Authorization, Caching, Logging, Transaction, and Validation cross-cutting behaviors. The recommended pipeline provider since Kck v2. Registered via AddKckMediator(). |
GitHub repositories
This package is not used by any popular GitHub repositories.