public QueryResultContext(ISqlExcuter excutor, DbDataReader reader, DbConnection connection, IDbConnectionProvider provider) { Reader = reader; ResultTable = QueryResultTableMetaData.Create(reader); ConnectionProvider = provider; Connection = connection; Excutor = excutor; }
public static QueryResultTableMetaData Create(IDataReader reader) { var result = new QueryResultTableMetaData(); var index = 0; while (index < reader.FieldCount) { var column = new QuryResultColumnInfo() { Name = reader.GetName(index), SqlType = reader.GetFieldType(index), Index = index, }; result.Columns.Add(column.Name, column); ++index; } return(result); }