Exemplo n.º 1
0
        /// <summary>
        /// Obtains a collection of resource properties that are needed for skip token generation
        /// </summary>
        /// <param name="orderingInfo">Input orderingInfo.</param>
        /// <param name="rt">Resource type for which to collect the skip token properties</param>
        /// <returns>Collection of resource properties used in $skiptoken</returns>
        internal static ICollection <ResourceProperty> CollectSkipTokenProperties(OrderingInfo orderingInfo, ResourceType rt)
        {
            Debug.Assert(orderingInfo != null, "Must have valid ordering information to collect skip token properties");
            Debug.Assert(orderingInfo.IsPaged, "Must have paging enabled to collection skip token properties");

            List <ResourceProperty> resourceProperties = new List <ResourceProperty>();

            foreach (OrderingExpression o in orderingInfo.OrderingExpressions)
            {
                LambdaExpression     l       = (LambdaExpression)o.Expression;
                NeedSkipTokenVisitor visitor = new NeedSkipTokenVisitor(rt);
                visitor.Visit(l.Body);
                if (visitor.NeedSkipToken)
                {
                    return(null);
                }
                else
                {
                    Debug.Assert(visitor.Property != null, "Must have a valid property if skip token is not needed");
                    resourceProperties.Add(visitor.Property);
                }
            }

            return(resourceProperties);
        }
Exemplo n.º 2
0
 internal static ICollection<ResourceProperty> CollectSkipTokenProperties(OrderingInfo orderingInfo, ResourceType rt)
 {
     List<ResourceProperty> list = new List<ResourceProperty>();
     foreach (OrderingExpression expression in orderingInfo.OrderingExpressions)
     {
         LambdaExpression expression2 = (LambdaExpression) expression.Expression;
         NeedSkipTokenVisitor visitor = new NeedSkipTokenVisitor(rt);
         visitor.Visit(expression2.Body);
         if (visitor.NeedSkipToken)
         {
             return null;
         }
         list.Add(visitor.Property);
     }
     return list;
 }
Exemplo n.º 3
0
 internal static bool IsSkipTokenRequired(OrderingInfo orderingInfo)
 {
     if ((orderingInfo != null) && orderingInfo.IsPaged)
     {
         foreach (OrderingExpression expression in orderingInfo.OrderingExpressions)
         {
             LambdaExpression expression2 = (LambdaExpression) expression.Expression;
             NeedSkipTokenVisitor visitor = new NeedSkipTokenVisitor();
             visitor.Visit(expression2.Body);
             if (visitor.NeedSkipToken)
             {
                 return true;
             }
         }
     }
     return false;
 }
Exemplo n.º 4
0
 internal static bool IsSkipTokenRequired(OrderingInfo orderingInfo)
 {
     if ((orderingInfo != null) && orderingInfo.IsPaged)
     {
         foreach (OrderingExpression expression in orderingInfo.OrderingExpressions)
         {
             LambdaExpression     expression2 = (LambdaExpression)expression.Expression;
             NeedSkipTokenVisitor visitor     = new NeedSkipTokenVisitor();
             visitor.Visit(expression2.Body);
             if (visitor.NeedSkipToken)
             {
                 return(true);
             }
         }
     }
     return(false);
 }
Exemplo n.º 5
0
        internal static ICollection <ResourceProperty> CollectSkipTokenProperties(OrderingInfo orderingInfo, ResourceType rt)
        {
            List <ResourceProperty> list = new List <ResourceProperty>();

            foreach (OrderingExpression expression in orderingInfo.OrderingExpressions)
            {
                LambdaExpression     expression2 = (LambdaExpression)expression.Expression;
                NeedSkipTokenVisitor visitor     = new NeedSkipTokenVisitor(rt);
                visitor.Visit(expression2.Body);
                if (visitor.NeedSkipToken)
                {
                    return(null);
                }
                list.Add(visitor.Property);
            }
            return(list);
        }
        /// <summary>
        /// Obtains a collection of resource properties that are needed for skip token generation
        /// </summary>
        /// <param name="orderingInfo">Input orderingInfo.</param>
        /// <param name="rt">Resource type for which to collect the skip token properties</param>
        /// <returns>Collection of resource properties used in $skiptoken</returns>
        internal static ICollection<ResourceProperty> CollectSkipTokenProperties(OrderingInfo orderingInfo, ResourceType rt)
        {
            Debug.Assert(orderingInfo != null, "Must have valid ordering information to collect skip token properties");
            Debug.Assert(orderingInfo.IsPaged, "Must have paging enabled to collection skip token properties");

            List<ResourceProperty> resourceProperties = new List<ResourceProperty>();
            foreach (OrderingExpression o in orderingInfo.OrderingExpressions)
            {
                LambdaExpression l = (LambdaExpression)o.Expression;
                NeedSkipTokenVisitor visitor = new NeedSkipTokenVisitor(rt);
                visitor.Visit(l.Body);
                if (visitor.NeedSkipToken)
                {
                    return null;
                }
                else
                {
                    Debug.Assert(visitor.Property != null, "Must have a valid property if skip token is not needed");
                    resourceProperties.Add(visitor.Property);
                }
            }

            return resourceProperties;
        }