예제 #1
0
 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());
 }
예제 #2
0
 public IEnumerable <Projeto> Get()
 {
     return(_projetoRepository.ObterTodos());
 }
예제 #3
0
 public IActionResult Todos()
 {
     ViewBag.Projetos = _projetoRepository.ObterTodos();
     return(View());
 }
예제 #4
0
 public async Task <IEnumerable <ProjetoViewModel> > Get()
 {
     return(_mapper.Map <IEnumerable <ProjetoViewModel> >(await _projetoRepository.ObterTodos()));
 }