public override async void Up() { using (var client = CosmosDbHelper.GetDocumentClient()) { await CreatePostsCollectionAsync(client); } }
/// <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 }); } }