示例#1
0
        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);
        }