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

                if (results.Length == 0)
                {
                    return(NotFound(MSG.NaoExisteProfessor));
                }
                return(Ok(results));
            }
            catch (Exception)
            {
                return(this.StatusCode(StatusCodes.Status501NotImplemented, MSG.BancoDadosFalhou));
            }
        }
Пример #2
0
 public IQueryable <ProfessorListModel> GetAllProfessores()
 => professorRepository.GetAllProfessores().ProjectTo <ProfessorListModel>(mapper.ConfigurationProvider);