public ActionResult Create(ProcessPerspectiveViewModel processPerspective) { if (ModelState.IsValid) { var procModel = AutoMapper.Mapper.Map<ProcessPerspectiveViewModel, ProcessPerspective>(processPerspective); this.processPerspectiveService.Add(procModel); } return RedirectToAction("Index"); }
public ActionResult Edit(int id, ProcessPerspectiveViewModel processPerspective) { try { if (ModelState.IsValid) { var procModel = AutoMapper.Mapper.Map<ProcessPerspectiveViewModel, ProcessPerspective>(processPerspective); this.processPerspectiveService.Update(procModel); } return RedirectToAction("Index"); } catch { return View(); } }