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