Example #1
0
        public IEnumerator <T> GetEnumerator()
        {
            DbCommandFactor commandFactor = this.GenerateCommandFactor();
            var             enumerator    = QueryEnumeratorCreator.CreateEnumerator <T>(this._query.DbContext.AdoSession, commandFactor);

            return(enumerator);
        }
Example #2
0
        public IEnumerator <T> GetEnumerator()
        {
            DbCommandFactor     commandFactor = this.GenerateCommandFactor();
            QueryEnumerator <T> enumerator    = QueryEnumeratorCreator.CreateEnumerator <T>(commandFactor, async(cmdFactor, @async) =>
            {
                IDataReader dataReader = await this._query.DbContext.Session.ExecuteReader(cmdFactor.CommandText, CommandType.Text, cmdFactor.Parameters, @async);

                return(DataReaderReady(dataReader, cmdFactor.ObjectActivator));
            });

            return(enumerator);
        }
Example #3
0
        public IEnumerator <T> GetEnumerator()
        {
            DbCommandFactor commandFactor = this.GenerateCommandFactor();
            var             enumerator    = QueryEnumeratorCreator.CreateEnumerator <T>(commandFactor, cmdFactor =>
            {
                IDataReader dataReader = this._query.DbContext.AdoSession.ExecuteReader(cmdFactor.CommandText, cmdFactor.Parameters, CommandType.Text);

                if (cmdFactor.ObjectActivator is RootEntityActivator)
                {
                    dataReader = new QueryDataReader(dataReader);
                }

                cmdFactor.ObjectActivator.Prepare(dataReader);

                return(dataReader);
            });

            return(enumerator);
        }