Example #1
0
        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));
        }
Example #2
0
        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);
        }
Example #3
0
            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);
            }
Example #4
0
            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);
            }