public Editora Adicionar(Editora obj) { BeginTransaction(); var returno = _editoraService.Adicionar(obj); Commit(); return(returno); }
public async Task <IActionResult> Create(EditoraViewModel editoraViewModel) { if (!ModelState.IsValid) { return(View(editoraViewModel)); } var editora = _mapper.Map <Editora>(editoraViewModel); await _editoraService.Adicionar(editora); if (!OperacaoValida()) { return(View(editoraViewModel)); } return(RedirectToAction("Index")); }