public ActionResult DeleteCommand(int id) { var commandModelFromRepo = _repository.GetCommandById(id); if (commandModelFromRepo == null) { return(NotFound()); } _repository.Delete(commandModelFromRepo); _repository.SaveChanges(); return(NoContent()); }
public ActionResult DeleteCommand(int id) { var result = _repository.GetCommandById(id); if (result == null) { return(NotFound()); } _repository.Delete(result); _repository.SaveChanges(); return(NoContent()); }
public ActionResult Delete(int id) { var command = _repo.Show(id); if (command is null) { return(NotFound()); } _repo.Delete(command); _repo.SaveChanges(); return(NoContent()); }