Пример #1
0
 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));
 }
Пример #2
0
 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));
     }
 }