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

            return(View());
        }
예제 #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));
            }
        }
예제 #3
0
 public ActionResult Index()
 {
     ViewBag.Alunos = _alunoService.BuscarTodos();
     return(View());
 }