Esempio n. 1
0
        protected internal override Expression VisitSkip(SkipLinqExpression node)
        {
            var reducedSource = Visit(node.Source);

            Skip = Convert.ToInt32(node.Count.Value);

            return(node.Reduce(reducedSource));
        }
Esempio n. 2
0
 protected internal override Expression VisitSkip(SkipLinqExpression node)
 {
     return(MergeValue(
                node,
                n => n.Count,
                (i, o) => Expression.Constant(Convert.ToInt32(i.Value) + Convert.ToInt32(o.Value)),
                (s, v) => new SkipLinqExpression(node.Method, s, v)
                ));
 }
        protected internal override Expression VisitSkip(SkipLinqExpression node)
        {
            var source = Visit(node.Source);

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

            return(node);
        }
Esempio n. 4
0
        /// <summary>
        /// Visits the children of a <see cref="SkipLinqExpression"/>.
        /// </summary>
        /// <param name="node">The expression to visit.</param>
        /// <returns>If any children were modified, a new <see cref="SkipLinqExpression"/>. Otherwise, the original expression.</returns>
        protected internal virtual Expression VisitSkip(SkipLinqExpression node)
        {
            var source = Visit(node.Source);
            var count  = (ConstantExpression)Visit(node.Count);

            if (source != node.Source || count != node.Count)
            {
                return(new SkipLinqExpression(node.Method, source, count));
            }

            return(node);
        }
Esempio n. 5
0
 protected internal override Expression VisitSkip(SkipLinqExpression node)
 {
     return(Visit(node.Source));
 }