public ActionResult CommandDelete(int id) { var commandModelFromRepo = _repository.GetCommandById(id); if (commandModelFromRepo == null) { return(NotFound()); } _repository.DeleteComand(commandModelFromRepo); _repository.SaveChanges(); return(NoContent()); }