Пример #1
0
 public override void VisitOrderByClause(OrderByClause orderByClause, QueryModel queryModel, int index)
 {
     foreach (var ordering in orderByClause.Orderings)
     {
         m_orderByParts.Add(OrderByExpressionVisitor.GetStatement(m_parameters, ordering.Expression, ordering.OrderingDirection));
     }
 }
Пример #2
0
            public static string GetStatement(Parameters parameters, Expression expression, OrderingDirection orderingDirection)
            {
                var expressionVisitor = new OrderByExpressionVisitor(parameters);

                expressionVisitor.VisitExpression(expression);

                if (orderingDirection == OrderingDirection.Desc)
                {
                    expressionVisitor.Statement.Append(" desc");
                }

                return(expressionVisitor.GetStatement());
            }