async Task CreateOrUpdateInBatch(TransactionalBatch batch) { if (etag == null) { batch.CreateItemStream(ToStream(value)); } else { var options = new TransactionalBatchItemRequestOptions { IfMatchEtag = etag }; batch.ReplaceItemStream(TransactionEntityId, ToStream(value), options); } var response = await batch.ExecuteAsync().ConfigureAwait(false); if (!response.IsSuccessStatusCode) { throw new Exception(response.ToString()); } etag = response.Last().ETag; }
public override void Apply(TransactionalBatch transactionalBatch, PartitionKeyPath partitionKeyPath) { transactionalBatch.ReplaceItemStream(id, streamPayload, options); }