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
<PackageReference Include="Carried.Idempotency.EntityFrameworkCore" Version="1.2.0" />
<PackageVersion Include="Carried.Idempotency.EntityFrameworkCore" Version="1.2.0" />
<PackageReference Include="Carried.Idempotency.EntityFrameworkCore" />
paket add Carried.Idempotency.EntityFrameworkCore --version 1.2.0
#r "nuget: Carried.Idempotency.EntityFrameworkCore, 1.2.0"
#:package Carried.Idempotency.EntityFrameworkCore@1.2.0
#addin nuget:?package=Carried.Idempotency.EntityFrameworkCore&version=1.2.0
#tool nuget:?package=Carried.Idempotency.EntityFrameworkCore&version=1.2.0
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 | Versions 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. |
-
net10.0
- Carried.Idempotency (>= 1.2.0)
- Carried.Idempotency.DependencyInjection (>= 1.2.0)
- Microsoft.EntityFrameworkCore.Relational (>= 10.0.11)
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 |