Configuration & Integrations — Idempotency
Wire IdempotencyEngine, background retention cleanup, ASP.NET Core HTTP middleware, Mediator behaviors, and relational/Redis stores via DI.
services.AddIdempotencyCore(options => { ... })— registersIdempotencyEngineand validatesDefaultRetentionDuration >= DefaultLeaseDuration.services.AddIdempotencyCleanupService(options => { ... })— registers background expiration pruning.services.AddPostgreSqlIdempotencyStore(...)— requires anNpgsqlDataSourceregistered in DI.InMemoryIdempotencyStore(TimeProvider? timeProvider = null)inEricksonLopez.Idempotency.Testinghas no DI helper; register explicitly withservices.AddSingleton<IIdempotencyStore>(new InMemoryIdempotencyStore()).
- ASP.NET Core (
EricksonLopez.Idempotency.AspNetCore): Callservices.AddAspNetCoreIdempotency(...)andapp.UseIdempotency(), or decorate Minimal APIs with.WithIdempotency()/[Idempotent](v2.0.0metadata precedence perADR-018). - Mediator (
EricksonLopez.Idempotency.Mediator): Callservices.AddMediatorIdempotency()to wrap idempotent commands in the mediator pipeline.