public async Task <IActionResult> Novo(AutorViewModel autorViewModel) { if (ModelState.IsValid) { var autor = AutorFactory.MapearAutor(autorViewModel); await _criarAutor.Executar(autor); return(RedirectToAction("Index")); } return(View(autorViewModel)); }
public async Task <IActionResult> Alterar(int id, AutorViewModel autorViewModel) { if (!ModelState.IsValid) { return(View(autorViewModel)); } var autor = AutorFactory.MapearAutor(autorViewModel); await _alterarAutor.Executar(id, autor); return(RedirectToAction("Index")); }