Google.GData.ContentForShopping.ContentForShoppingService.CreateBatchFeed C# (CSharp) Method

CreateBatchFeed() protected method

takes a list of products, adds batch operation and adds each item to a feed
protected CreateBatchFeed ( List products, GDataBatchOperationType operation ) : Google.GData.ContentForShopping.ProductFeed
products List the list of products to add to a feed
operation GDataBatchOperationType
return Google.GData.ContentForShopping.ProductFeed
        protected ProductFeed CreateBatchFeed(List<ProductEntry> products, GDataBatchOperationType operation) {
            ProductFeed feed = new ProductFeed(null, this);

            foreach(ProductEntry product in products)
            {
                if (product.BatchData != null) {
                    product.BatchData.Type = operation;
                }
                else {
                    product.BatchData = new GDataBatchEntryData(operation);
                }

                feed.Entries.Add(product);
            }

            return feed;
        }