BusinessData.DataAccess.SPA.SPADAO.GetProfessores C# (CSharp) Метод

GetProfessores() публичный Метод

Retorna todas os professores cadastrados no SPA
public GetProfessores ( ) : IList
Результат IList
        public IList<Entities.Professor> GetProfessores()
        {
            DbCommand cmdSelect = baseDados.GetSqlStringCommand(QueryMap.Default.Professores);
            Entities.Professor professor = null;
            try
            {
                IList<Entities.Professor> listaAux = new List<Entities.Professor>();
                using (IDataReader leitor = baseDados.ExecuteReader(cmdSelect))
                {
                    while (leitor.Read())
                    {
                        string nomeProfessor = leitor.GetValue(leitor.GetOrdinal("Professor")).ToString();
                        string matricula = leitor.GetValue(leitor.GetOrdinal("Matricula")).ToString();
                        string correioEletronico = leitor.GetValue(leitor.GetOrdinal("Correio Eletronico")).ToString();
                        professor = Entities.Professor.NewProfessor(matricula, nomeProfessor, correioEletronico);
                        listaAux.Add(professor);
                    }
                }
                return listaAux;
            }
            catch (Exception ex)
            {
                throw new DataAccessException("Erro ao ler dados.", ex);
            }
        }