Skip to content

Instantly share code, notes, and snippets.

@dontpaniclabsgists
Last active August 28, 2017 13:56
Show Gist options
  • Save dontpaniclabsgists/f2989c2e03d10d908ad5d49a14727379 to your computer and use it in GitHub Desktop.
Save dontpaniclabsgists/f2989c2e03d10d908ad5d49a14727379 to your computer and use it in GitHub Desktop.
Cosmos2_4
public async Task<Note> ReadOne(string id, string customerId)
{
using (var client = new DocumentClient(new Uri(_endpoint), _key))
{
var link = UriFactory.CreateDocumentUri(_databaseId, CollectionId, id);
var note = await client.ReadDocumentAsync<Note>(link,
new RequestOptions()
{
PartitionKey = new Microsoft.Azure.Documents.PartitionKey(customerId)
});
return note;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment