public object Execute(Expression expression) { TranslateResult result = this.Translate(expression); if (result.SQLCommand != null) { this.misession.Do(result.SQLCommand); } Type elementType = TypeSystem.GetElementType(expression.Type); IMapInfoDataReader reader = this.readerfactory.GetReaderFor(result.TableName); ITable table = this.misession.Tables.GetTable(result.TableName); EntityMaterializer materializer = this.entityfactory.CreateMaterializerFor(table, reader); if (result.Projector != null) { Delegate projector = result.Projector.Compile(); return(Activator.CreateInstance(typeof(ProjectionReader <>).MakeGenericType(elementType), new object[] { reader, projector })); } return(Activator.CreateInstance(typeof(RowList <>).MakeGenericType(elementType), new object[] { reader, materializer })); }
public RowList(IMapInfoDataReader reader, EntityMaterializer factory) { this.reader = reader; this.entityfactory = factory; }
public EntityMaterializer CreateMaterializerFor(ITable table, IMapInfoDataReader reader) { return(new EntityMaterializer(this.misession, table, reader)); }
internal Enumerator(IMapInfoDataReader reader, Func <IMapInfoDataReader, T> projector) { this.reader = reader; this.projector = projector; }
public ProjectionReader(IMapInfoDataReader reader, Func <IMapInfoDataReader, T> projector) { this.enumerator = new Enumerator(reader, projector); }
public EntityMaterializer(MapInfoSession miSession, ITable table, IMapInfoDataReader mapInfoDataReader) { this.MapifoSession = miSession; this.datareader = mapInfoDataReader; this.Table = table; }
public RowEnumerator(IMapInfoDataReader recordSelector, EntityMaterializer entityFactory) { this.datareader = recordSelector; this.entityfactory = entityFactory; }