DKNet.AspCore.Idempotency.Relational 10.1.10

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

DKNet.AspCore.Idempotency.Relational

NuGet License: MIT

Shared Entity Framework Core base for building relational DKNet.AspCore.Idempotency stores — the entity, the entity mapping, the shared DbContext, and the concurrency-safe insert-or-query pattern that DKNet.AspCore.Idempotency.MsSqlStore and DKNet.AspCore.Idempotency.NpgsqlStore both derive from.

This is an internal base package, not something app authors register directly. If you are adding idempotency to an app, install DKNet.AspCore.Idempotency plus a concrete provider package (.MsSqlStore / .NpgsqlStore) instead. Use this package only when implementing support for a new relational database.

Features

  • Shared IdempotencyKeyEntity and IEntityTypeConfiguration<IdempotencyKeyEntity> mapping every relational provider reuses as-is
  • Shared IdempotencyDbContext base with automatic discovery of the derived provider's own entity configuration
  • Race-safe insert-or-query reservation pattern (IdempotencyRelationalStore<TContext>) backed by a unique-index guarantee, including atomic reclaim of expired reservations
  • Per-connection-string migration guard so a process serving multiple databases migrates each one exactly once
  • Only two seams left to each provider: the response-body column type/check-constraint SQL, and how to recognize that provider's own unique-key-violation error

Installation

dotnet add package DKNet.AspCore.Idempotency.Relational

Quick Start — implementing a new provider store

A new relational provider derives four types from this package:

// 1. Closed DbContext
internal sealed class IdempotencyDbContext(DbContextOptions<IdempotencyDbContext> options)
    : DKNet.AspCore.Idempotency.Relational.Data.IdempotencyDbContext(options);

// 2. Provider-specific mapping details
internal sealed class IdempotencyKeyConfiguration
    : DKNet.AspCore.Idempotency.Relational.Data.Configurations.IdempotencyKeyConfiguration
{
    protected override string BodyColumnType => "text";
    protected override string StatusCodeCheckConstraintSql => "\"StatusCode\" BETWEEN 100 AND 599";
}

// 3. Provider-specific unique-violation detection
internal sealed class IdempotencyPostgresStore(
    IServiceProvider serviceProvider, IOptions<IdempotencyOptions> options, ILogger<IdempotencyPostgresStore> logger)
    : IdempotencyRelationalStore<IdempotencyDbContext>(serviceProvider, options, logger)
{
    protected override bool IsProviderUniqueViolation(DbUpdateException ex) =>
        ex.InnerException is PostgresException { SqlState: PostgresErrorCodes.UniqueViolation };
}

// 4. DI wiring (own project's setup extension)
services.AddDbContext<IdempotencyDbContext>(o => o.UseNpgsql(connectionString))
    .AddDbContextFactory<IdempotencyDbContext>();
services.AddIdempotentKey<IdempotencyPostgresStore>();

Because the base types here are internal, the new provider project must be added to this package's InternalsVisibleTo list.

Requirements

  • .NET 10.0+
  • Microsoft.EntityFrameworkCore / Microsoft.EntityFrameworkCore.Relational
  • DKNet.AspCore.Idempotency (automatically included)

Full documentation

See DKNet.AspCore.Idempotency.Relational for the full feature breakdown, mapping defaults, and gotchas.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Developed by Steven Hoang.

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

Showing the top 2 NuGet packages that depend on DKNet.AspCore.Idempotency.Relational:

Package Downloads
DKNet.AspCore.Idempotency.MsSqlStore

DKNet is an enterprise-grade .NET library collection focused on advanced EF Core extensions, dynamic predicate building, and the Specification pattern. It provides production-ready tools for building robust, type-safe, and testable data access layers, including dynamic LINQ support, LinqKit integration. Designed for modern cloud-native applications, DKNet enforces strict code quality, async best practices, and full documentation for all public APIs. Enterprise-grade .NET library suite for modern application development, featuring advanced EF Core extensions (dynamic predicates, specifications, LinqKit), robust Domain-Driven Design (DDD) patterns, and domain event support. DKNet empowers scalable, maintainable, and testable solutions with type-safe validation, async/await, XML documentation, and high code quality standards. Ideal for cloud-native, microservices, and enterprise architectures.

DKNet.AspCore.Idempotency.NpgsqlStore

DKNet is an enterprise-grade .NET library collection focused on advanced EF Core extensions, dynamic predicate building, and the Specification pattern. It provides production-ready tools for building robust, type-safe, and testable data access layers, including dynamic LINQ support, LinqKit integration. Designed for modern cloud-native applications, DKNet enforces strict code quality, async best practices, and full documentation for all public APIs. Enterprise-grade .NET library suite for modern application development, featuring advanced EF Core extensions (dynamic predicates, specifications, LinqKit), robust Domain-Driven Design (DDD) patterns, and domain event support. DKNet empowers scalable, maintainable, and testable solutions with type-safe validation, async/await, XML documentation, and high code quality standards. Ideal for cloud-native, microservices, and enterprise architectures.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
10.1.10 51 8/22/2026
10.1.9 47 8/22/2026
10.1.8 42 8/21/2026
10.1.7 56 8/21/2026
10.1.6 54 8/21/2026