public IActionResult Edit(RoutingViewModel routing) { //Only Id is set via the page, so get the value alongside the id routing.Source = _repository.GetOneBusinessProcess(p => p.Id == routing.Source.Id); routing.Destination = _repository.GetOneBusinessProcess(p => p.Id == routing.Destination.Id); if (ModelState.IsValid) { _repository.Update(Mapper.Map <Routing>(routing)); return(RedirectToAction("Index")); } return(View(routing)); }
// GET: BusinessProcesses/Details/5 public IActionResult Details(int?id) { if (id == null) { return(HttpNotFound()); } BusinessProcessViewModel businessProcess = Mapper.Map <BusinessProcessViewModel>(_repository.GetOneBusinessProcess(b => b.Id == id)); if (businessProcess == null) { return(HttpNotFound()); } return(View(businessProcess)); }