Created
August 24, 2017 18:15
-
-
Save dontpaniclabsgists/6991e816dc3f80aa1dd247452b946556 to your computer and use it in GitHub Desktop.
Cosmos3_2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public int CountSql() | |
{ | |
using (var client = new DocumentClient(new Uri(_endpoint), _key)) | |
{ | |
var link = UriFactory.CreateDocumentCollectionUri(_databaseId, CollectionId); | |
var count = client.CreateDocumentQuery<int>( | |
link, | |
"select value count(1) from notes", | |
new FeedOptions() | |
{ | |
EnableCrossPartitionQuery = true | |
}) | |
.AsEnumerable() | |
.First(); | |
return count; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment