Ejemplo n.º 1
0
        protected internal override Expression VisitFirst(FirstLinqExpression node)
        {
            var source = Visit(node.Source);

            if (source != node.Source)
            {
                return(new FirstLinqExpression(node.Method, source, node.Predicate));
            }

            return(node);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Visits the children of a <see cref="FirstLinqExpression"/>.
        /// </summary>
        /// <param name="node">The expression to visit.</param>
        /// <returns>If any children were modified, a new <see cref="FirstLinqExpression"/>. Otherwise, the original expression.</returns>
        protected internal virtual Expression VisitFirst(FirstLinqExpression node)
        {
            var source    = Visit(node.Source);
            var predicate = (LambdaExpression)VisitPredicate(node.Predicate);

            if (source != node.Source || predicate != node.Predicate)
            {
                return(new FirstLinqExpression(node.Method, source, predicate));
            }

            return(node);
        }
Ejemplo n.º 3
0
 protected internal override Expression VisitFirst(FirstLinqExpression node) => VisitCondition(node);