public async Task <IActionResult> Get()
        {
            try
            {
                var results = await _repo.GetAllAlunos();

                if (results.Length == 0)
                {
                    return(NotFound(MSG.NaoExisteAluno));
                }
                return(Ok(results));
            }
            catch (Exception)
            {
                return(this.StatusCode(StatusCodes.Status501NotImplemented, MSG.BancoDadosFalhou));
            }
        }
Beispiel #2
0
 public IQueryable <AlunoListModel> GetAllAlunos()
 => alunoRepository.GetAllAlunos().ProjectTo <AlunoListModel>(mapper.ConfigurationProvider);