public static async Task OrderGiftsAsync(this CloudTable table, IEnumerable <GiftRow> giftsToOrder) { if (giftsToOrder.Any()) { TableBatchOperation batchOperation = new TableBatchOperation(); foreach (var item in giftsToOrder) { batchOperation.InsertOrReplace(item); } await table.ExecuteBatchAsync(batchOperation); } }
public static async Task UpdateOrdersAsync(this CloudTable table, IEnumerable <ReportOrderRow> ordersToReport) { if (ordersToReport.Any()) { TableBatchOperation batchOperation = new TableBatchOperation(); foreach (var item in ordersToReport) { batchOperation.InsertOrReplace(item); } await table.ExecuteBatchAsync(batchOperation); } }