public ItemController(IItemRepository repository) { _repository = repository; var flourItem = new Item { Name = "Flour", Quantity = new Quantity() { Unit = "L", Total = 1 } }; _repository.Add(flourItem); var eggItem = new Item { Name = "Egg", Quantity = new Quantity() { Unit = "P", Total = 8 } }; _repository.Add(eggItem); _fridgeService = new FridgeService(_repository); }
public Quantity Remove([FromBody] Item item) { return(_fridgeService.RemoveItem(item)); }
public Quantity Create([FromBody] Item item) { return(_fridgeService.AddItem(item)); }