Пример #1
0
        public IActionResult UpdateRoute(int id, RouteDto routeDto)
        {
            log.Info(nameof(RoutesController.UpdateRoute));

            try
            {
                if (id != routeDto.Id | routeDto == null)
                {
                    return(BadRequest());
                }

                if (!routeService.Exists(id))
                {
                    return(NotFound());
                }

                routeService.Update(routeDto);

                return(Ok(routeDto));
            }
            catch (Exception e)
            {
                log.Error(e);

                return(BadRequest());
            }
        }