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

            return(enumerator);
        }
Beispiel #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);
        }
Beispiel #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);
        }