Exemplo n.º 1
0
        public async Task <IActionResult> AddAluno(string turmaId)
        {
            var alunos = await _alunoRepository.GetAlunos();

            ViewBag.TurmaId = turmaId;
            ViewBag.Alunos  = alunos;

            return(View("AddAluno"));
        }
        public async Task <ActionResult> GetAlunos()
        {
            try
            {
                var result = await _repo.GetAlunos();

                return(Ok(result));
            }
            catch (System.Exception ex)
            {
                return(StatusCode(
                           StatusCodes.Status500InternalServerError,
                           $"Erro no retorno da lista de alunos.{ex.Message}"
                           ));
            }
        }
Exemplo n.º 3
0
        // GET: Aluno
        public async Task <IActionResult> Index()
        {
            var alunos = await _alunoRepository.GetAlunos();

            return(View(alunos));
        }
        public List <Aluno> GetAlunos()
        {
            var listaAlunos = _alunoRepository.GetAlunos();

            return(listaAlunos);
        }
Exemplo n.º 5
0
        public async Task <IEnumerable <Aluno> > RetornaAlunos()
        {
            var alunos = await _alunoRepository.GetAlunos();

            return(alunos);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Metodo para retorna  todos Alunos
        /// </summary>
        /// <returns></returns>
        public List <Aluno> GetAlunos()
        {
            var result = _IAlunoRepository.GetAlunos();

            return(result);
        }
Exemplo n.º 7
0
        public async Task <ActionResult <IEnumerable <AlunoViewModel> > > GetAlunosAll()
        {
            var aluno = new Aluno();

            return(Ok(await _repository.GetAlunos(aluno)));
        }
Exemplo n.º 8
0
 public IQueryable <Aluno> GetAlunos()
 {
     return(_alunoRepository.GetAlunos());
 }