Exemplo n.º 1
0
        public IQueryable <TElement> CreateQuery <TElement>(Expression expression)
        {
            if (typeof(TElement) == typeof(T))
            {
                var query = (IQueryable <T>)OriginalProvider.CreateQuery <TElement>(expression);

                if (query is IOrderedQueryable <TElement> )
                {
                    var includeQuery = new QueryIncludeOrderedQueryable <T, T2>(query, IncludeQuery.Selector, IncludeQuery.IncludeQuery);
                    return((IOrderedQueryable <TElement>)includeQuery);
                }
                else
                {
                    var includeQuery = new QueryIncludeQueryable <T, T2>(query, IncludeQuery.Selector, IncludeQuery.IncludeQuery);
                    return((IQueryable <TElement>)includeQuery);
                }
            }
            throw new Exception("not supported yet");
        }
Exemplo n.º 2
0
 public QueryIncludeProvider(IQueryProvider provider, QueryIncludeOrderedQueryable <T, T2> includeQuery)
 {
     OriginalProvider    = provider;
     IncludeOrderedQuery = includeQuery;
 }