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 })); }
public object Execute(Expression expression) { MethodInfo methodInfo = CachingQueryableCache.GetCachingQueryableExecuteMethodInfo(typeof(T), expression.Type); return(methodInfo.Invoke(this, new object[] { expression })); }
IEnumerator IEnumerable.GetEnumerator() { MethodInfo methodInfo = CachingQueryableCache.GetCachingQueryableGetEnumeratorMethodInfo(typeof(T)); return((IEnumerator)methodInfo.Invoke(this, null)); }