Exemplo n.º 1
0
        public ActionResult EditTrain(TrainViewModel trainView)
        {
            var mapper   = new MapperConfiguration(cfg => cfg.CreateMap <TrainViewModel, TrainDTO>()).CreateMapper();
            var trainDto = mapper.Map <TrainViewModel, TrainDTO>(trainView);

            _trainService.EditTrain(trainDto);
            return(RedirectToAction("ShowTrains"));
        }
Exemplo n.º 2
0
        public IActionResult Edit()
        {
            string id = trainService.EditTrain(new StreamReader(Request.Body).ReadToEnd());

            return(Redirect("/Train/Info?id=" + id));
        }