public ActionResult Delete(int id, LancamentoModel model) { try { if (ModelState.IsValid) { lancamentoServices.SetEndpoint("Lancamento"); if (lancamentoServices.Delete(id).Result != null) { return(RedirectToAction("Index")); } } return(View(model)); } catch (Exception e) { return(View(model)); } }