Exemplo n.º 1
0
        public IActionResult UpdateLine(int LineId, [FromBody] LineDto LineDto)
        {
            //null Dto
            if (LineDto == null || LineId != LineDto.Id)
            {
                return(BadRequest(ModelState));
            }


            //create the network
            var newLine = _mapper.Map <Line>(LineDto);

            //check if record was created successfully or not

            if (!_LineRepository.UpdateLine(newLine))
            {
                ModelState.AddModelError("", $"Something is wrong with the upating of the record{newLine.Id}");
                return(StatusCode(500, ModelState));
            }

            return(NoContent());
        }
Exemplo n.º 2
0
 public bool UpdateLine(DbTrainLine trainLineIn)
 {
     return(_lineRepository.UpdateLine(trainLineIn));
 }