// Add many of one item public void Add(InventoryItem inventoryItem, int quantity) { for (int i = 0; i < quantity; i++) { inventoryItem.Id = i + _items.Count(); _items.Add(inventoryItem); } }
// Add one of one item public void Add(InventoryItem inventoryItem) { inventoryItem.Id = _items.Count(); _items.Add(inventoryItem); }