public static HashSet <ColumnExpression> Gather(Expression expression) { ReferencedColumnGatherer gatherer = new ReferencedColumnGatherer(); gatherer.Visit(expression); return(gatherer.columns); }
protected override Expression VisitSelect(SelectExpression select) { ILookup <TableAlias, ColumnExpression> columns = this.columns; this.columns = ReferencedColumnGatherer.Gather(select).ToLookup <ColumnExpression, TableAlias>(c => c.Alias); JoinType?lastJoin = this.lastJoin; this.lastJoin = null; Expression expression = base.VisitSelect(select); this.columns = columns; this.lastJoin = lastJoin; return(expression); }