Exemplo n.º 1
0
        public ActionResult Index()
        {
            ViewBag.Alunos    = _alunoService.BuscarTodos();
            ViewBag.AlunoNome = "";
            ViewBag.Tarefas   = new List <Tarefa>();
            ViewBag.IdAluno   = -1;

            return(View());
        }
Exemplo n.º 2
0
        public async Task <ActionResult <IEnumerable <AlunoViewModel> > > ObterTodos()
        {
            try
            {
                var listaAlunos = await _alunoService.BuscarTodos();

                return(Ok(_mapper.Map <IEnumerable <AlunoViewModel> >(listaAlunos)));
            }
            catch (Exception ex)
            {
                return(BadRequest(ex.Message));
            }
        }
Exemplo n.º 3
0
 public ActionResult Index()
 {
     ViewBag.Alunos = _alunoService.BuscarTodos();
     return(View());
 }