Example #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Name,EcpCode,Description")] StationViewModel stationViewModel)
        {
            if (id != stationViewModel.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                var stationDto = _mapper.Map <StationDto>(stationViewModel);
                var result     = await _stationDtoAcessLayer.EditStation(stationDto);

                return(result ? RedirectToAction("Index") : null); //TODO: null заменить на страницу с ошибками.
            }
            return(View(stationViewModel));
        }