Skip to content

Instantly share code, notes, and snippets.

@dontpaniclabsgists
Created August 24, 2017 18:14
Show Gist options
  • Save dontpaniclabsgists/ee5b49872ad7c8b79ba2a5311063e867 to your computer and use it in GitHub Desktop.
Save dontpaniclabsgists/ee5b49872ad7c8b79ba2a5311063e867 to your computer and use it in GitHub Desktop.
cosmos3_1
public int Count()
{
using (var client = new DocumentClient(new Uri(_endpoint), _key))
{
var link = UriFactory.CreateDocumentCollectionUri(_databaseId, CollectionId);
var count = client.CreateDocumentQuery<Note>(
link,
new FeedOptions()
{
EnableCrossPartitionQuery = true
})
.Count();
return count;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment