public IActionResult Cadastro([FromForm] Tarefa tarefa, int projetoId) { ViewBag.Projetos = _projetoRepository.ObterTodos(); if (ModelState.IsValid) { _tarefaRepository.Add(tarefa); return(RedirectToAction("Todas", "Tarefa", new { id = tarefa.ProjetoId })); } ViewBag.Projeto = _projetoRepository.ObterPorId(projetoId); ViewBag.Mensagem = "Campos invalidos!"; return(View()); }
public IEnumerable <Projeto> Get() { return(_projetoRepository.ObterTodos()); }
public IActionResult Todos() { ViewBag.Projetos = _projetoRepository.ObterTodos(); return(View()); }
public async Task <IEnumerable <ProjetoViewModel> > Get() { return(_mapper.Map <IEnumerable <ProjetoViewModel> >(await _projetoRepository.ObterTodos())); }