Class CosmosInboxTransactionScopeExtensions
Provider-specific extensions for obtaining the Cosmos DB-native transactional batch from an opaque IInboxTransactionScope handed to an inbox handler by the scoped transactional store.
public static class CosmosInboxTransactionScopeExtensions
- Inheritance
-
CosmosInboxTransactionScopeExtensions
- Inherited Members
Methods
AsCosmosBatch(IInboxTransactionScope)
Obtains the Cosmos DB TransactionalBatch from the opaque inbox transaction scope, so a handler can add its own operations to the batch and have them commit atomically with the processed-mark.
public static TransactionalBatch AsCosmosBatch(this IInboxTransactionScope scope)
Parameters
scopeIInboxTransactionScopeThe opaque scope handed to the handler by the Cosmos DB scoped transactional store.
Returns
- TransactionalBatch
The transactional batch the handler's operations should be added to.
Exceptions
- ArgumentNullException
Thrown when
scopeis null.- InvalidOperationException
Thrown when
scopedid not originate from the Cosmos DB inbox store (a wrong-provider scope, for example a MongoDB scope). This fails loud rather than returning null or an obscure cast failure, surfacing a provider mismatch immediately.