Пример #1
0
        public ActionResult <Dictionary <string, Inventory> > DeleteItem(string id, Inventory inv)
        {
            _repo.DeleteItem(id, inv);

            if (inv.Id != id)
            {
                return(NotFound());
            }

            return(Ok());
        }
Пример #2
0
        public ActionResult DeleteItem(int id)
        {
            var itemModelFromRepo = _repository.GetItemById(id);

            if (itemModelFromRepo == null)
            {
                return(NotFound());
            }

            _repository.DeleteItem(itemModelFromRepo);
            _repository.SaveChanges();

            return(NoContent());
        }