protected internal override Expression VisitCount(CountLinqExpression node) { var source = Visit(node.Source); if (source != node.Source) { return(new CountLinqExpression(node.Method, source, node.Predicate)); } return(node); }
/// <summary> /// Visits the children of a <see cref="CountLinqExpression"/>. /// </summary> /// <param name="node">The expression to visit.</param> /// <returns>If any children were modified, a new <see cref="CountLinqExpression"/>. Otherwise, the original expression.</returns> protected internal virtual Expression VisitCount(CountLinqExpression node) { //By virtue of the fact we exist we must have a predicate var source = Visit(node.Source); var predicate = (LambdaExpression)VisitPredicate(node.Predicate); if (source != node.Source || predicate != node.Predicate) { return(new CountLinqExpression(node.Method, source, predicate)); } return(node); }
protected internal override Expression VisitCount(CountLinqExpression node) => VisitCondition(node);