常用方法
常用方法
常用方法
常用方法
public ActionResult DeleteCommand(int id) { // 取得commandModel var commandModelFromRepo = _repository.GetCommandById(id); // 如果不存在要回NotFound if (commandModelFromRepo == null) { return(NotFound()); } _repository.DeleeteCommand(commandModelFromRepo); _repository.SaveChanges(); return(NoContent()); }