public ActionResult DeleteItem(int id)
        {
            var itemModelFromRepo = _item.GetItemById(id);

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

            _item.DeleteItem(itemModelFromRepo);
            _item.SaveChanges();
            return(NoContent());
        }
 public void RemoveItem(int itemId)
 {
     InitNonExistingRepo();
     ItemRepo.DeleteItem(itemId);
     UowManager.Save();
 }
예제 #3
0
 public async Task <bool> Delete(string itemId)
 {
     return(await itemRepo.DeleteItem(itemId));
 }