Пример #1
0
        public ActionResult UpdateCommand(int id, CommandUpdateDto commandUpdateDto)
        {
            var commandModelFromRepo = _repository.GetCommandById(id);

            if (commandModelFromRepo == null)
            {
                return(NotFound());
            }
            _mapper.Map(commandUpdateDto, commandModelFromRepo);
            _repository.UpdateCommandById(commandModelFromRepo);
            _repository.SaveChanges();
            //Return 204
            return(NoContent());
        }