IObjectActivator CreateObjectActivator(IDataReader dataReader) { Type type = typeof(T); if (type != PublicConstants.TypeOfObject && MappingTypeSystem.IsMappingType(type)) { PrimitiveObjectActivatorCreator activatorCreator = new PrimitiveObjectActivatorCreator(type, 0); return(activatorCreator.CreateObjectActivator()); } return(GetObjectActivator(type, dataReader)); }
public override IObjectActivatorCreator GenarateObjectActivatorCreator(DbSqlQueryExpression sqlQuery) { int ordinal; ordinal = ObjectModelHelper.TryGetOrAddColumn(sqlQuery, this.Expression).Value; PrimitiveObjectActivatorCreator activatorCreator = new PrimitiveObjectActivatorCreator(this.ObjectType, ordinal); activatorCreator.CheckNullOrdinal = ObjectModelHelper.TryGetOrAddColumn(sqlQuery, this.NullChecking); return(activatorCreator); }
void Prepare() { Type type = typeof(T); if (type != UtilConstants.TypeOfObject && MappingTypeSystem.IsMappingType(type)) { PrimitiveObjectActivatorCreator activatorCreator = new PrimitiveObjectActivatorCreator(type, 0); this._objectActivator = activatorCreator.CreateObjectActivator(); this._reader = this.ExecuteReader(); return; } this._reader = this.ExecuteReader(); this._objectActivator = GetObjectActivator(type, this._reader); }
async Task Prepare(bool @async) { Type type = typeof(T); if (type != PublicConstants.TypeOfObject && MappingTypeSystem.IsMappingType(type)) { PrimitiveObjectActivatorCreator activatorCreator = new PrimitiveObjectActivatorCreator(type, 0); this._objectActivator = activatorCreator.CreateObjectActivator(); this._reader = await this.ExecuteReader(@async); return; } this._reader = await this.ExecuteReader(@async); this._objectActivator = GetObjectActivator(type, this._reader); }