Exemplo n.º 1
0
 private static void NeedsOrdering(OrderingFinder finder, MethodCallExpression node)
 {
     if (QueryableUtility.IsOrderingMethod(node))
     {
         finder.NeedsOrderBy = false;
         finder.state = Finish;
     }
 }
Exemplo n.º 2
0
 private static void Start(OrderingFinder finder, MethodCallExpression node)
 {
     if (methods.Any(m => m.Equals(node.Method.Name)))
     {
         finder.NeedsOrderBy = true;
         finder.state = NeedsOrdering;
     }
 }
Exemplo n.º 3
0
 private static void NeedsOrdering(OrderingFinder finder, MethodCallExpression node)
 {
     if (QueryableUtility.IsOrderingMethod(node))
     {
         finder.NeedsOrderBy = false;
         finder.state        = Finish;
     }
 }
Exemplo n.º 4
0
 private static void Start(OrderingFinder finder, MethodCallExpression node)
 {
     if (methods.Any(m => m.Equals(node.Method.Name)))
     {
         finder.NeedsOrderBy = true;
         finder.state        = NeedsOrdering;
     }
 }
Exemplo n.º 5
0
 internal static bool NeedsOrderMethod(Expression expression)
 {
     OrderingFinder finder = new OrderingFinder
     {
         NeedsOrderBy = false
     };
     finder.Visit(expression);
     return finder.NeedsOrderBy;
 }
Exemplo n.º 6
0
        internal static bool NeedsOrderMethod(Expression expression)
        {
            OrderingFinder finder = new OrderingFinder
            {
                NeedsOrderBy = false
            };

            finder.Visit(expression);
            return(finder.NeedsOrderBy);
        }
Exemplo n.º 7
0
 public Expression Visit(IQueryable query)
 {
     if (OrderingFinder.NeedsOrderMethod(query.Expression))
     {
         // Create Ordered at root and combine both queries.
         var orderedQuery = query.OrderBy(this.propertyAccessor.GetAccessor <T>());
         return(QueryComposer.Compose(orderedQuery, query).Expression);
     }
     return(query.Expression);
 }