public static IQueryable FindSource(Expression e)
        {
            var visitor = new QuerySourceExpressionVisitor();

            visitor.Visit(e);
            return(visitor.sourceQueryable);
        }
예제 #2
0
        static Type FindSourceType(Expression e)
        {
            var sourceQuery = QuerySourceExpressionVisitor.FindSource(e);

            if (sourceQuery == null)
            {
                throw new NotSupportedException("Unable to identify an IQueryable source for this query.");
            }
            return(sourceQuery.ElementType);
        }