Querying documents in multiple partitions with LINQ
The following lines declare the code for the ListScheduledCompetitionsWithLinq
asynchronous static method, which builds a LINQ query to retrieve the titles for all the scheduled competitions that have more than five registered competitors and show them in the console output.
Add the following lines to the existing code of the Program.cs
file. The code file for the sample is included in the learning_cosmos_db_05_01
folder in the SampleApp2/SampleApp1/Program.cs
file:
private static async Task ListScheduledCompetitionsWithLinq() { // Retrieve the titles for all the scheduled competitions that have more than 5 registered competitors var selectTitleQuery = client.CreateDocumentQuery<Competition>(collectionUri, new FeedOptions() { EnableCrossPartitionQuery = true, MaxItemCount = 100, }) .Where(c => (c.NumberOfRegisteredCompetitors > 5) && (c...