Devkumi.SharedKernel.Persistence 1.0.0

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

Devkumi.SharedKernel.Persistence

EF Core 10 + PostgreSQL persistence base for Clean Architecture / DDD projects targeting .NET 10.

What's included

Type Description
AuditableContext<T> Abstract DbContext that auto-stamps CreatedUserId, CreatedAtUtc, LastModifiedUserId, LastModifiedAtUtc on every save
OutboxMessage Entity that stores serialised domain events for reliable async dispatch
ConvertDomainEventsToOutboxMessagesInterceptor EF Core SaveChangesInterceptor that converts aggregate domain events into OutboxMessage rows atomically
UnitOfWork<T> IUnitOfWork implementation wrapping DbContext.SaveChangesAsync
ISpecification<T> / HeroSpecification<T> Specification pattern with criteria, includes, and ordering
QueryableExtensions .Specify<T>() and .ToPaginatedListAsync() helpers
AddDatabaseConfiguration<T>() Registers the DbContext with Npgsql + snake_case naming + OutBox interceptor
AddUnitOfWork<T>() Registers IUnitOfWork scoped to a specific DbContext

Installation

dotnet add package Devkumi.SharedKernel.Persistence --version 1.0.0

Usage

// In your module's DI
services.AddDatabaseConfiguration<MyDbContext>(configuration);
services.AddUnitOfWork<MyDbContext>();
// Your DbContext
public sealed class MyDbContext(DbContextOptions<MyDbContext> options, ICurrentUserService currentUser)
    : AuditableContext<MyDbContext>(options, currentUser)
{
    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        base.OnModelCreating(modelBuilder);
        modelBuilder.HasDefaultSchema("myschema");
        modelBuilder.ApplyConfigurationsFromAssembly(typeof(MyDbContext).Assembly);
    }
}

Connection string

Set CONNECTION_STRING as an environment variable or in appsettings.json.

Dependencies

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 (1)

Showing the top 1 NuGet packages that depend on Devkumi.SharedKernel.Persistence:

Package Downloads
Devkumi.SharedKernel.Infrastructure

Infrastructure services: JWT authentication, CurrentUserService, Hangfire outbox job processor, Redis cache, Polly resilience.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 147 6/17/2026