Class SqlInboxTransactionScopeExtensions
Extensions for obtaining the relational BCL transaction handle from an opaque IInboxTransactionScope handed to an inbox handler by a relational scoped transactional store (SqlServer, Postgres).
public static class SqlInboxTransactionScopeExtensions
- Inheritance
-
SqlInboxTransactionScopeExtensions
- Inherited Members
Methods
AsSqlTransaction(IInboxTransactionScope)
Obtains the active BCL IDbTransaction from the opaque inbox transaction scope, so a handler can enlist its own writes atomically with the processed-mark.
public static IDbTransaction AsSqlTransaction(this IInboxTransactionScope scope)
Parameters
scopeIInboxTransactionScopeThe opaque scope handed to the handler by a relational scoped transactional store.
Returns
- IDbTransaction
The active local database transaction the handler's writes should enlist in.
Exceptions
- ArgumentNullException
Thrown when
scopeis null.- InvalidOperationException
Thrown when
scopedid not originate from a relational inbox store (a wrong-provider scope, for example a MongoDB or Cosmos DB scope). This fails loud rather than returning null or an obscure cast failure, surfacing a provider mismatch immediately.