Retrieving a POCO with a LINQ asynchronous query

Now open the Program.cs file and add the following using statements after the last line that declares a using statement: using System.Threading.Tasks;. The code file for the sample is included in the learning_cosmos_db_06_01 folder in the SampleApp1/SampleApp1/Program.cs file:

using System.Collections.Generic; 
using SampleApp1.Models; 
using SampleApp1.Types; 

Add the following static field to the Program class after the code that declares the client static field: private static DocumentClient client;. In this new version, we will save the Uri instance for the document collection in this field to reuse it in all the methods that require the collection URI:

private static Uri collectionUri;

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

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.