PouryaKit.Persistence.EFCore 0.1.0-preview.2

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

PouryaKit.Persistence.EFCore

NuGet .NET 10 License: MIT

PouryaKit.Persistence.EFCore

The EF Core Unit of Work. A Module's DbContext derives from PouryaKitDbContext, and for each Operation the Unit of Work runs the Domain Event Handlers, stamps audit and soft-delete fields, writes the Outbox, saves once and commits. A concurrent change, or a duplicate value on a unique index the Module mapped, comes back as an Error.

Install

dotnet add package PouryaKit.Persistence.EFCore --prerelease

When to use it

  • You are mapping an aggregate.
  • Two aggregates of one Module must change together, in one commit: a Domain Event Handler.
  • An aggregate needs audit fields, soft delete or a unique value.
  • You read a sorted and filtered Page through the repository.

You rarely reference it alone: PouryaKit.Persistence.Postgres brings it and adds the database. PouryaKit.Messaging.Wolverine.EFCore joins its Unit of Work to the message store.

Quick start

Derive the Module's DbContext, then map only what is specific, as the Proving Sample does:

internal sealed class CatalogDbContext(DbContextOptions<CatalogDbContext> options)
    : PouryaKitDbContext(options);

internal sealed class ProductConfiguration : IEntityTypeConfiguration<Product>
{
    public const string NameIndex = "ix_products_name";

    public void Configure(EntityTypeBuilder<Product> builder)
    {
        builder.ToTable("products");
        builder.Property(product => product.Name).HasMaxLength(200);
        builder
            .HasIndex(product => new { product.Tenant, product.Name })
            .IsUnique()
            .HasFilter("is_deleted = false")
            .HasDatabaseName(NameIndex);
    }
}

What you get

  • One save and one commit per Operation, in a fixed sequence, with no save in your code.
  • Domain Event Handlers that join that same commit.
  • Audit and soft-delete fields set by the Unit of Work, never by the domain.
  • A concurrent change as a conflict Error, and a mapped unique index as the Error the Module chose.
  • A Page through the repository, sorted and filtered only by what the query declared.

The repository writes only inside a Unit of Work, so an add or a remove anywhere else throws instead of being silently lost.

Learn more

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 PouryaKit.Persistence.EFCore:

Package Downloads
PouryaKit.Persistence.Postgres

Each Module's EF Core data in its own PostgreSQL schema on Npgsql, with unique-value Errors and gap-free number sequences.

PouryaKit.Messaging.Wolverine.EFCore

Every EF Core Module's Outbox and Receipts on Wolverine: what a Module publishes is written in the commit of its change, in PostgreSQL.

PouryaKit.Realtime

Server-sent events pushed from Notification Handlers, carried between a Host's instances by PostgreSQL notifications, only within the delivery's tenant.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0-preview.2 92 11/1/2026
0.1.0-preview.1 106 10/31/2026
0.1.0-preview.0.28 97 10/26/2026