public ActionResult <Dictionary <string, Inventory> > DeleteItem(string id, Inventory inv) { _repo.DeleteItem(id, inv); if (inv.Id != id) { return(NotFound()); } return(Ok()); }
public ActionResult DeleteItem(int id) { var itemModelFromRepo = _repository.GetItemById(id); if (itemModelFromRepo == null) { return(NotFound()); } _repository.DeleteItem(itemModelFromRepo); _repository.SaveChanges(); return(NoContent()); }