Class MongoInboxTransactionScopeExtensions
Provider-specific extensions for obtaining the MongoDB-native transaction handle from an opaque IInboxTransactionScope handed to an inbox handler by the scoped transactional store.
public static class MongoInboxTransactionScopeExtensions
- Inheritance
-
MongoInboxTransactionScopeExtensions
- Inherited Members
Methods
AsMongoSession(IInboxTransactionScope)
Obtains the MongoDB MongoDB.Driver.IClientSessionHandle carrying the active transaction from the opaque inbox transaction scope, so a handler can enlist its own writes atomically with the processed-mark.
public static IClientSessionHandle AsMongoSession(this IInboxTransactionScope scope)
Parameters
scopeIInboxTransactionScopeThe opaque scope handed to the handler by the MongoDB scoped transactional store.
Returns
- IClientSessionHandle
The client session handle whose transaction the handler's writes should enlist in.
Exceptions
- ArgumentNullException
Thrown when
scopeis null.- InvalidOperationException
Thrown when
scopedid not originate from the MongoDB inbox store (a wrong-provider scope, for example a Cosmos DB scope). This fails loud rather than returning null or an obscure cast failure, surfacing a provider mismatch immediately.