public ActionResult Edit(ContatoModel contatoModel) { try { contatoModel = _contatoAppService.Editar(contatoModel); foreach (var erro in contatoModel.ListaErros) { ModelState.AddModelError(erro.Key, erro.Value); } if (ModelState.IsValid) { return(RedirectToAction(nameof(Index))); } else { return(View(contatoModel)); } } catch { return(View()); } }