Now we will write the code for the CreateAndQueryDynamicDocumentsAsync
asynchronous static method, which calls the previously created and explained asynchronous static methods. 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
file:
private static async Task CreateAndQueryDynamicDocumentsAsync() { var database = await RetrieveOrCreateDatabaseAsync(); Console.WriteLine( $"The database {databaseId} is available for operations with the following AltLink: {database.AltLink}"); var collection = await CreateCollectionIfNotExistsAsync(); Console.WriteLine( $"The collection {collectionId} is available for operations with the following AltLink: {collection.AltLink}"); ...