Namespace Stratara.EventSourcing.EntityFrameworkCore
Namespaces
Classes
- CommitCompletionInterceptor
Lets a commit, once begun, run to its end whatever the caller's cancellation says. A database driver that is told to cancel while it waits for a commit to be acknowledged may report the cancellation after the database committed; the caller then takes a committed save for one that failed, and whatever runs it — a transport, a retry, a resumed command — runs it again and records the same facts twice. With this interceptor a cancellation is honoured while the changes are written, which leaves nothing behind, and no longer once the commit has begun, so what the caller is told is what happened. A save that would run as a single statement outside a transaction — committed by the database the moment the statement ends, with no commit to let run — is given a transaction as well.
- UnitOfWork<TDbContext>
Base IUnitOfWork implementation backed by an EF Core IDbContextFactory<TContext>. Each StartAsync(CancellationToken) call mints a fresh DbContext that lives for the duration of the returned transaction.