Пример #1
0
 public ActionResult Create(AuthorDetailViewModel viewModel)
 {
     try
     {
         this.authorsUseCase.Create(new AuthorDto
         {
             FirstName = viewModel.FirstName,
             LastName = viewModel.LastName,
             Email = viewModel.Email
         });
         return RedirectToAction("Index");
     }
     catch
     {
         return View();
     }
 }
Пример #2
0
 public ActionResult Edit(int id, AuthorDetailViewModel viewModel)
 {
     try
     {
         this.authorsUseCase.Update(new AuthorDto
         {
             Id = viewModel.Id,
             FirstName = viewModel.FirstName,
             LastName = viewModel.LastName,
             Email = viewModel.Email
         });
         return RedirectToAction("Index");
     }
     catch
     {
         return View();
     }
 }