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(); } }
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); } }