Retrieving a document with an asynchronous query

The following lines declare the code for the GetCompetitionByTitle asynchronous static method, which builds a query to retrieve a competition with a specific title from the document collection. The code takes advantage of the possibilities offered by the SDK to limit the number of results returned by the query and execute the query with an asynchronous execution. The code adds complexity to work with an asynchronous execution. We don't want to run a query with a synchronous execution in our examples. 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_04_01 folder in the dot_net_core_2_samples/SampleApp1/SampleApp1/Program.cs ...

Get Guide to NoSQL with Azure Cosmos DB now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.