public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { SelectProjetos = new SelectList(await _projetoRepository.ListarAsync(), "IdProjeto", "Nome"); SelectSistemas = new SelectList(await _sistemaRepository.ListarAsync(), "IdSistema", "Descricao"); SelectWorkflows = new SelectList(await _workflowRepository.ListarAsync(), "IdWorkflow", "Nome"); SelectTipoTarefas = new SelectList(await _tipoTarefaRepository.ListarAsync(), "IdTipoTarefa", "Nome"); return(Page()); } await _tarefaRepository.IncluirAsync(Tarefa); return(RedirectToPage("Listar")); }