Exemple #1
0
        public async Task <IList <T> > ToListAsync()
        {
            Enumerator        e = this.enumerator;
            SqoQuery <TOuter> SqoQueryOuterImp = SqoQueryOuter as SqoQuery <TOuter>;
            SqoQuery <TInner> SqoQueryInnerImp = SqoQueryInner as SqoQuery <TInner>;

            if (SqoQueryOuterImp != null)
            {
                List <KeyValuePair <int, int> > oids = await SqoQueryOuterImp.Siaqodb.LoadOidsForJoinAsync <T, TOuter, TInner>(SqoQueryOuterImp, SqoQueryInnerImp, outerExpression, innerExpression);

                e.oids      = oids;
                e.siaqodb   = SqoQueryOuterImp.Siaqodb;
                e.outerType = typeof(TOuter);
                e.innerType = typeof(TInner);
                List <T> list = new List <T>();
                while (e.MoveNext())
                {
                    list.Add(e.Current);
                }
                return(list);
            }
            else
            {
                throw new LINQUnoptimizeException("cannot optimize");
            }
            //this.enumerator = null;
        }
Exemple #2
0
        public IEnumerator <T> GetEnumerator()
        {
            Enumerator        e = this.enumerator;
            SqoQuery <TOuter> SqoQueryOuterImp = SqoQueryOuter as SqoQuery <TOuter>;
            SqoQuery <TInner> SqoQueryInnerImp = SqoQueryInner as SqoQuery <TInner>;

            if (SqoQueryOuterImp != null)
            {
                List <KeyValuePair <int, int> > oids = SqoQueryOuterImp.Siaqodb.LoadOidsForJoin <T, TOuter, TInner>(SqoQueryOuterImp, SqoQueryInnerImp, outerExpression, innerExpression);

                e.oids      = oids;
                e.siaqodb   = SqoQueryOuterImp.Siaqodb;
                e.outerType = typeof(TOuter);
                e.innerType = typeof(TInner);
            }
            else
            {
                throw new LINQUnoptimizeException("cannot optimize");
            }
            //this.enumerator = null;
            return(e);
        }
Exemple #3
0
 public ProjectionSelectReader(List <SqoColumn> columns, Func <ProjectionRow, T> projector, SqoQuery <TSource> query)
 {
     this.enumerator = new EnumeratorSelect <T>(columns, projector);
     this.query      = query;
 }
Exemple #4
0
 public IncludeSqoQuery(SqoQuery <T> query, params string[] properties)
 {
     this.originalQuery = query;
     includes.AddRange(properties);
 }