Esempio n. 1
0
        public ActionResult EditStation(int?id)
        {
            StationDTO stationDto = _stationService.GetStation(id);

            if (stationDto == null)
            {
                throw new ValidationException("Не установлено id станции", "");
            }
            var mapper      = new MapperConfiguration(cfg => cfg.CreateMap <StationDTO, StationViewModel> ()).CreateMapper();
            var stationView = mapper.Map <StationDTO, StationViewModel>(stationDto);

            return(View(stationView));
        }