public ActionResult Create(ClienteViewModel viewModel) { try { if (!ModelState.IsValid) { return(View(viewModel)); } _clienteApp.Add(viewModel); return(RedirectToAction("Index", "Home")); } catch { return(View(viewModel)); } }
public async Task <ActionResult> Create(ClienteViewModel viewModel) { try { if (!ModelState.IsValid) { return(View(viewModel)); } var resultado = _clienteApp.Add(viewModel); return(RedirectToAction(nameof(Index))); } catch { return(View()); } }