Kck.Persistence.Abstractions 5.0.0

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

Kck.Persistence.Abstractions

Repository and Unit-of-Work persistence abstractions — IReadRepository<T,TId>, IWriteRepository<T,TId>, QueryOptions, dynamic filtering and IUnitOfWork. The Entity Framework implementation is Kck.Persistence.EntityFramework.

Installation

dotnet add package Kck.Persistence.Abstractions
dotnet add package Kck.Persistence.EntityFramework

Quick Start

// Program.cs — register the Entity Framework provider
using Kck.Persistence.EntityFramework.Extensions;

builder.Services.AddKckPersistence(p => p
    .UseEntityFramework<AppDbContext>(o => o
        .UseSqlServer(builder.Configuration.GetConnectionString("Default")))
    .AddAuditInterceptor());   // CreatedDate / ModifiedDate / soft-delete fields

// Repositories come from the unit of work
public sealed class OrderHandlers(IUnitOfWork uow)
{
    public Task<Order?> GetAsync(Guid orderId, CancellationToken ct)
        => uow.Repository<Order, Guid>().GetByIdAsync(orderId, cancellationToken: ct);

    public async Task<Order> CreateAsync(Order order, CancellationToken ct)
    {
        await uow.Repository<Order, Guid>().AddAsync(order, ct);
        await uow.SaveChangesAsync(cancellationToken: ct);
        return order;
    }

    // Filtered, ordered page; QueryOptions controls soft-deleted rows and change tracking
    public Task<IPaginate<Order>> ActiveAsync(CancellationToken ct)
        => uow.Repository<Order, Guid>().GetListAsync(
            QueryOptions.None,
            predicate: o => o.Total > 0,
            orderBy: q => q.OrderByDescending(o => o.CreatedDate),
            size: 20,
            cancellationToken: ct);
}

When options is omitted, GetAsync / GetListAsync / GetListByDynamicAsync track entities and AnyAsync / GetByIdAsync / CountAsync do not. QueryOptions.WithDeleted does not track; to load a soft-deleted row and save changes to it, pass new QueryOptions(IncludeDeleted: true, AsTracking: true).

Resources

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (3)

Showing the top 3 NuGet packages that depend on Kck.Persistence.Abstractions:

Package Downloads
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().

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.Bundle.WebApi

Opinionated ASP.NET Core WebAPI starter pack. Registers Serilog, in-memory caching, the JWT token service, Argon2 hashing, InMemory event bus, health checks, rate limiting, security headers, CORS, and global exception handling in a single AddKckWebApiDefaults() call.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
5.0.0 311 11/2/2026
4.8.0 658 10/31/2026
Loading failed