Example #1
0
        S IAstVisitor <T, S> .VisitQueryOrderClause(QueryOrderClause queryOrderClause, T data)
        {
            var handler = QueryOrderClauseVisited;

            if (handler != null)
            {
                handler(queryOrderClause, data);
            }
            return(VisitChildren(queryOrderClause, data));
        }
Example #2
0
            public override AstNode VisitQueryOrderClause(QueryOrderClause queryOrderClause)
            {
                var  current = currentResult;
                bool first   = true;

                foreach (var o in queryOrderClause.Orderings)
                {
                    string methodName = first ? (o.Direction == QueryOrderingDirection.Descending ? "OrderByDescending" : "OrderBy")
                                                                  : (o.Direction == QueryOrderingDirection.Descending ? "ThenByDescending" : "ThenBy");

                    var param = CreateParameterForCurrentRangeVariable();
                    current = current.Invoke(methodName, CreateLambda(new[] { param }, VisitNested(o.Expression, param)));
                    MapExpression(o, current);
                    first = false;
                }
                return(current);
            }
Example #3
0
 void IAstVisitor.VisitQueryOrderClause(QueryOrderClause queryOrderClause)
 {
     Visit(EnterQueryOrderClause, LeaveQueryOrderClause, queryOrderClause);
 }
Example #4
0
        protected internal override bool DoMatch(AstNode other, PatternMatching.Match match)
        {
            QueryOrderClause o = other as QueryOrderClause;

            return(o != null && this.Orderings.DoMatch(o.Orderings, match));
        }