public ActionResult Edit(int id, EditoraViewModel editora) { if (ModelState.IsValid) { var _editoraDomain = Mapper.Map <EditoraViewModel, Editora>(editora); _editoraAppService.Update(_editoraDomain); return(RedirectToAction("Index")); } return(View(editora)); }
public ActionResult Edit(EditoraViewModel editora) { try { if (ModelState.IsValid) { var editoraDomain = Mapper.Map <EditoraViewModel, Editora>(editora); _editoraApp.Update(editoraDomain); return(RedirectToAction("Index")); } return(View(editora)); } catch (Exception e) { return(View(e.Message)); } }