Shaolinq.Persistence.Linq.Optimizers.SqlRedundantSubqueryRemover.VisitSelect C# (CSharp) Method

VisitSelect() protected method

protected VisitSelect ( SqlSelectExpression select ) : Expression
select Shaolinq.Persistence.Linq.Expressions.SqlSelectExpression
return System.Linq.Expressions.Expression
		protected override Expression VisitSelect(SqlSelectExpression select)
		{
			select = (SqlSelectExpression)base.VisitSelect(select);

			// Expand all purely redundant subqueries

			var redundantQueries = SqlRedundantSubqueryFinder.Find(select.From);

			if (redundantQueries != null)
			{
				select = SubqueryRemover.Remove(select, redundantQueries);
			}

			return select;
		}