コード例 #1
0
 public void SaveOrder(Order order, bool newOrder = true)
 {
     if (newOrder)
     {
         cosmosDbService.AddItemAsync <Order>(CosmosDbContainers.Orders, order).GetAwaiter().GetResult();
     }
     else
     {
         cosmosDbService.UpdateItemAsync <Order>(CosmosDbContainers.Orders, order).GetAwaiter().GetResult();
     }
 }
コード例 #2
0
 public async Task SaveProduct(ProductDocDb docDbProduct, bool newProduct = true)
 {
     docDbProduct.ImageUrls = null;
     if (newProduct)
     {
         await cosmosDbService.AddItemAsync <ProductDocDb>(CosmosDbContainers.Products, docDbProduct).ConfigureAwait(false);
     }
     else
     {
         await cosmosDbService.UpdateItemAsync <ProductDocDb>(CosmosDbContainers.Products, docDbProduct).ConfigureAwait(false);
     }
 }