Skip to content

Search EricksonLopez.* Ecosystem

Type a library name, NuGet package ID, .NET type, or architectural concept to search across the portal.

Guides & Recipes — Transaction

Production patterns for nested savepoint recovery, explicit read-only scopes, and zero-DB unit tests.

When an outer ExecuteResultAsync scope calls an inner repository or service method that also invokes ExecuteResultAsync, TransactionOptions.Default uses NestedTransactionBehavior.UseSavepoint automatically. If the inner operation returns Result.Failure(...), only the inner savepoint rolls back while the outer transaction remains open to decide recovery or final rollback.

Pass TransactionOptions.ReadOnlyMode (or TransactionOptions.WithTimeout(TimeSpan.FromSeconds(3))) for multi-query reporting endpoints so backends enforce read-only snapshot semantics and bounded lock waits.