public void DeleteInventoryItem(long inventoryId, long itemId) { var inventory = _inventoryRepository.FindById(inventoryId); var inventoryItem = inventory.Items.FirstOrDefault(i => i.Id == itemId); _inventoryItemRepository.Remove(inventoryItem); _inventoryItemRepository.UnitOfWork.Commit(); }
public void Remove(int id) { _inventoryRepository.Remove(id); _inventoryRepository.SaveChanges(); }