/// <summary> /// takes a list of entries, adds update as the batch operation and updates them /// /// Must have Id set on each entry as the proper location. /// Consider using AddLocalId for this. /// </summary> /// <param name="entries">the list of entries to update</param> /// <param name="accountId">The account ID of the user.</param> /// <returns>the returned InventoryFeed</returns> public InventoryFeed UpdateInventoryFeed(List <InventoryEntry> entries, string accountId) { Uri batchUri = CreateUri(accountId, "inventory", null, "batch"); InventoryFeed feed = new InventoryFeed(null, this); foreach (InventoryEntry entry in entries) { if (entry.BatchData != null) { entry.BatchData.Type = GDataBatchOperationType.update; } else { entry.BatchData = new GDataBatchEntryData(GDataBatchOperationType.update); } feed.Entries.Add(entry); } return(base.Batch(feed, batchUri) as InventoryFeed); }
/// <summary> /// takes a list of entries, adds update as the batch operation and updates them /// /// Must have Id set on each entry as the proper location. /// Consider using AddLocalId for this. /// </summary> /// <param name="entries">the list of entries to update</param> /// <param name="accountId">The account ID of the user.</param> /// <returns>the returned InventoryFeed</returns> public InventoryFeed UpdateInventoryFeed(List<InventoryEntry> entries, string accountId) { Uri batchUri = CreateUri(accountId, "inventory", null, "batch"); InventoryFeed feed = new InventoryFeed(null, this); foreach(InventoryEntry entry in entries) { if (entry.BatchData != null) { entry.BatchData.Type = GDataBatchOperationType.update; } else { entry.BatchData = new GDataBatchEntryData(GDataBatchOperationType.update); } feed.Entries.Add(entry); } return base.Batch(feed, batchUri) as InventoryFeed; }