Beispiel #1
0
 public override async void Up()
 {
     using (var client = CosmosDbHelper.GetDocumentClient())
     {
         await CreatePostsCollectionAsync(client);
     }
 }
Beispiel #2
0
 /// <summary>
 /// Creates a new database if it does not already exist
 /// </summary>
 /// <returns></returns>
 private async Task CreateAsync()
 {
     using (var client = CosmosDbHelper.GetDocumentClient())
     {
         await client.CreateDatabaseIfNotExistsAsync(new Database
         {
             Id = Constants.CosmosDb.DatabaseId
         });
     }
 }