public async Task <IActionResult> Cadastrar([FromForm] Aluguel aluguel) { if (ModelState.IsValid) { var aluguelCadastro = await _aluguelRepository.Cadastrar(aluguel); return(new RedirectToActionResult("Pagamento", "Aluguel", new { id = aluguelCadastro.Id })); } CarregarDados(); return(RedirectToAction(nameof(Index))); }