Exemplo n.º 1
0
        public async Task <IList <T> > ToListAsync()
        {
            EnumeratorSelect <T> e = this.enumerator;

            e.siaqodb = query.Siaqodb;
            List <int> oids = await this.query.GetFilteredOidsAsync();

            if (oids == null)
            {
                oids = await e.siaqodb.LoadAllOIDsAsync <TSource>();
            }
            e.oids = oids;

            if (e == null)
            {
                throw new InvalidOperationException("Cannot enumerate more than once");
            }
            List <T> list = new List <T>();

            while (await e.MoveNextAsync())
            {
                list.Add(e.Current);
            }
            return(list);
        }
Exemplo n.º 2
0
        public IEnumerator <T> GetEnumerator()
        {
            EnumeratorSelect <T> e = this.enumerator;

            e.siaqodb = query.Siaqodb;
            List <int> oids = this.query.GetFilteredOids();

            if (oids == null)
            {
                oids = e.siaqodb.LoadAllOIDs <TSource>();
            }
            e.oids = oids;

            if (e == null)
            {
                throw new InvalidOperationException("Cannot enumerate more than once");
            }

            //this.enumerator = null;
            return(e);
        }
Exemplo n.º 3
0
 public ProjectionSelectReader(List <SqoColumn> columns, Func <ProjectionRow, T> projector, SqoQuery <TSource> query)
 {
     this.enumerator = new EnumeratorSelect <T>(columns, projector);
     this.query      = query;
 }