Example #1
0
        public IQueryable CreateQuery(Expression expression)
        {
            if (_currentExpression == expression)
            {
                return(this);
            }

            Type elementType = TypeHelpers.FindElementType(expression);

            Type queryableType = CachingQueryableCache.GetCachingQueryableType(elementType);

            return((IQueryable)Activator.CreateInstance(
                       queryableType,
                       new object[] { _source, expression, _getQueryFunc }));
        }
Example #2
0
        public object Execute(Expression expression)
        {
            MethodInfo methodInfo = CachingQueryableCache.GetCachingQueryableExecuteMethodInfo(typeof(T), expression.Type);

            return(methodInfo.Invoke(this, new object[] { expression }));
        }
Example #3
0
        IEnumerator IEnumerable.GetEnumerator()
        {
            MethodInfo methodInfo = CachingQueryableCache.GetCachingQueryableGetEnumeratorMethodInfo(typeof(T));

            return((IEnumerator)methodInfo.Invoke(this, null));
        }