Guest User

Untitled

a guest
Mar 21st, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. public async Task SetAsync(string key, byte[] value, DistributedCacheEntryOptions options,
  2. CancellationToken token = default(CancellationToken))
  3. {
  4. var uri = UriFactory
  5. .CreateDocumentCollectionUri(_options.DatabaseName, _options.CollectionName);
  6.  
  7. var document = CosmosDbCacheItem.Build(
  8. key,
  9. (int)options.AbsoluteExpirationRelativeToNow.Value.TotalSeconds,
  10. value);
  11.  
  12. await _client.UpsertDocumentAsync(uri, document);
  13. }
Add Comment
Please, Sign In to add comment