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(); } }
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(); } }