示例#1
0
        public ActionResult DeleteCommand(int id)
        {
            // 取得commandModel
            var commandModelFromRepo = _repository.GetCommandById(id);

            // 如果不存在要回NotFound
            if (commandModelFromRepo == null)
            {
                return(NotFound());
            }
            _repository.DeleeteCommand(commandModelFromRepo);
            _repository.SaveChanges();
            return(NoContent());
        }