Example #1
0
 public static ICosmosStorageSession Create(this IWorkWithSharedTransactionalBatch workWith)
 {
     if (!workWith.CurrentContextBag.TryGet <PartitionKey>(out var partitionKey))
     {
         throw new Exception("To use the shared transactional batch a partition key must be set using a custom pipeline behavior.");
     }
     return(new SharedTransactionalBatch(workWith, partitionKey));
 }
 public void SetCurrent(IWorkWithSharedTransactionalBatch session)
 {
     pipelineContext.Value.Session = session;
 }
 public SharedTransactionalBatch(IWorkWithSharedTransactionalBatch operationsHolder, PartitionKey partitionKey)
 {
     this.operationsHolder = operationsHolder;
     PartitionKey          = partitionKey;
 }