public ActionResult DeleteCommand(int id) { var roleModelFromRepo = _repository.GetRoleById(id); if (roleModelFromRepo == null) { return(NotFound()); } _repository.DeleteRole(roleModelFromRepo); _repository.SaveChanges(); return(NoContent()); }