Carried.Idempotency.EntityFrameworkCore 1.2.0

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

Carried.Idempotency

A lightweight, storage-agnostic idempotency engine for .NET with ASP.NET Core integration and distributed storage providers.

Packages

Package Description
Carried.Idempotency Core idempotency engine
Carried.Idempotency.DependencyInjection Dependency injection infrastructure for providers
Carried.Idempotency.AspNet ASP.NET Core integration
Carried.Idempotency.Redis Distributed Redis provider
Carried.Idempotency.EntityFrameworkCore Entity Framework Core relational provider

๐Ÿ“ฅ Installation

ASP.NET Core

dotnet add package Carried.Idempotency.AspNet

Redis

dotnet add package Carried.Idempotency.Redis

Entity Framework Core

dotnet add package Carried.Idempotency.EntityFrameworkCore

Core

For use without ASP.NET Core:

dotnet add package Carried.Idempotency

Carried.Idempotency.DependencyInjection is normally installed transitively and does not need to be installed directly.

๐Ÿš€ Getting Started

ASP.NET Core

Register idempotency:

builder.Services.AddIdempotency(options =>
{
    options.UseInMemory();
});

Add the middleware:

app.UseIdempotency();

Enable idempotency on an endpoint:

app.MapPost("/orders", async () =>
{
    // Create order...
})
.RequireIdempotency();

Clients provide an idempotency key with the request:

Idempotency-Key: request-123

Controllers can use the RequireIdempotency attribute instead:

[RequireIdempotency]
[HttpPost]
public async Task<IActionResult> AddOrder()
{
    // Create order...
}

Redis

For distributed applications, register an IConnectionMultiplexer:

builder.Services.AddSingleton<IConnectionMultiplexer>(_ =>
    ConnectionMultiplexer.Connect(
        builder.Configuration.GetConnectionString("Redis")!));

Then select Redis as the provider:

builder.Services.AddIdempotency(options =>
{
    options.UseRedis();
});

The application owns the IConnectionMultiplexer and its lifetime.

Entity Framework Core

Register your DbContext and select the Entity Framework Core provider:

builder.Services.AddDbContext<AppDbContext>(options =>
{
    // Configure your database provider.
});

builder.Services.AddIdempotency(options =>
{
    options.UseDbContext<AppDbContext>();
});

Add the idempotency model configuration to your DbContext:

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
    base.OnModelCreating(modelBuilder);

    modelBuilder.AddIdempotency();
}

The idempotency table is managed through your application's normal Entity Framework Core migrations.

Core

The Core engine can be used independently of ASP.NET Core:

var idempotency = IdempotencyService.CreateInMemory();

var key = new IdempotencyKey(
    scope: "orders-create",
    value: "request-123");

var result = await idempotency.ExecuteAsync(
    key,
    fingerprint: "my-fingerprint-here",
    async cancellationToken =>
    {
        // Perform operation.

        return IdempotencyOperationResult<string>.Complete("result");
    },
    cancellationToken);

๐Ÿ’พ Storage Providers

Provider Package Status
In-memory Carried.Idempotency โœ… Available
Redis Carried.Idempotency.Redis โœ… Available
Entity Framework Core Carried.Idempotency.EntityFrameworkCore โœ… Available

The in-memory provider is intended for single-process use. Redis and Entity Framework Core support coordination across application instances using shared storage.

Custom providers can be implemented using IIdempotencyStore.

๐Ÿ“š Documentation

See the project documentation for guides, configuration, and API reference.

Carried.Idempotency Documentation

๐Ÿงช Example

An example ASP.NET Core application is available at:

examples/Carried.Idempotency.ExampleApi

๐Ÿ“‹ License

Carried.Idempotency is licensed under the MIT License.

See LICENSE for details.

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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.0 101 9/8/2026