public IEnumerable <string> ReadData(INamedDataReader namedDataReader) { using (namedDataReader) { while (namedDataReader.Read()) { yield return(namedDataReader.GetString(_column)); } } }
public IEnumerable <T> ReadData(INamedDataReader namedDataReader) { using (namedDataReader) { while (namedDataReader.Read()) { var dataObject = new T(); dataObject.InitializeFromReader(namedDataReader); yield return(dataObject); } } }
public IEnumerable <Agency> ReadData(INamedDataReader namedDataReader) { using (namedDataReader) { while (namedDataReader.Read()) { var agency = new Agency(); agency.InitializeFromReader(namedDataReader); yield return(agency); } } }
public IEnumerable <IList <string> > ReadData(INamedDataReader namedDataReader) { int columns = namedDataReader.FieldCount; ColumnNames = new List <string>(); for (int i = 0; i < columns; i++) { ColumnNames.Add(namedDataReader.GetName(i)); } using (namedDataReader) { while (namedDataReader.Read()) { IList <string> row = new List <string>(); for (int i = 0; i < columns; i++) { row.Add(namedDataReader.GetFieldValue <object>(i).ToString()); } yield return(row); } } }