Exemplo n.º 1
0
 public async Task Save(QueryModel queryModel)
 {
     queryModel.partitionKey = PartitionKeyGenerator.Generate(queryModel.id, _noOfPartitions);
     await DocumentDbRetryPolicy.ExecuteWithRetries(
         () => _client.UpsertDocumentAsync(GetCollectionUri(), queryModel, null, disableAutomaticIdGeneration: true)
         );
 }
Exemplo n.º 2
0
        private RequestOptions CreateRequestOptions(Guid id)
        {
            var key = PartitionKeyGenerator.Generate(id, _noOfPartitions);

            var options = new RequestOptions()
            {
                PartitionKey = new PartitionKey(key)
            };

            return(options);
        }