public ActionResult Create(AmigoEnderecoViewModel amigoViewModel) { try { // TODO: Add insert logic here if (ModelState.IsValid) { _amigoAppService.Add(amigoViewModel); } return(RedirectToAction("Index")); } catch (Exception ex) { string mensagem = string.Empty; foreach (var item in ModelState.Values.SelectMany(v => v.Errors).ToList()) { ViewBag.RetornoPost += string.Format("{0}\n\r", item.ErrorMessage); } return(View()); } }