protected override Expression VisitSelect(SelectExpression select) { select = (SelectExpression)base.VisitSelect(select); var inExpressions = InExpressionGatherer.Gather(select.Where); if (!inExpressions.Any()) { return(select); } var newSelect = AddInnerJoins(select, inExpressions); return(InExpressionRemover.Remove(newSelect, inExpressions)); }
public static ReadOnlyCollection<InExpression> Gather(Expression expression) { var gatherer = new InExpressionGatherer(); if (expression == null) { return gatherer._expressions.ToReadOnly(); } gatherer.Visit(expression); if (!gatherer._canRewrite) { gatherer._expressions.Clear(); } return gatherer._expressions.ToReadOnly(); }
public static ReadOnlyCollection <InExpression> Gather(Expression expression) { var gatherer = new InExpressionGatherer(); if (expression == null) { return(gatherer._expressions.ToReadOnly()); } gatherer.Visit(expression); if (!gatherer._canRewrite) { gatherer._expressions.Clear(); } return(gatherer._expressions.ToReadOnly()); }