/// <summary> /// Reduces the node and then calls the visitor delegate on the reduced expression. The method throws an exception if the node is not reducible. /// </summary> /// <param name="visitor">An instance of <see cref="T:System.Func`2" />.</param> /// <returns> /// The expression being visited, or an expression which should replace it in the tree. /// </returns> protected override Expression VisitChildren(ExpressionVisitor visitor) { visitor.Visit(ColumnsExpression.Reduce()); visitor.Visit(TableExpression); if (WhereExpression != null) { visitor.Visit(WhereExpression); } if (GroupByExpression != null) { visitor.Visit(GroupByExpression); } if (OrderByExpression != null) { visitor.Visit(OrderByExpression); } return(this); }
/// <summary> /// Sets the columns expression. /// </summary> /// <param name="columnExpression">The column expression.</param> /// <exception cref="System.ArgumentException">'columnExpression' can be applied only once.;columnsExpression</exception> public void SetColumnsExpression(ColumnsExpression columnExpression) { Check.NotNull(columnExpression, nameof(columnExpression)); _columnsExpression = columnExpression; }