Represents an element in the 'ORDER BY' clause of the query.
Inheritance: DbExpression
        /// <summary>
        /// Translates the <paramref name="orderByExpression"/> into a string representation.
        /// </summary>
        /// <param name="orderByExpression">The <see cref="DbOrderByExpression"/> to translate.</param>
        /// <returns><see cref="string"/></returns>
        protected override DbExpression VisitOrderByExpression(DbOrderByExpression orderByExpression)
        {
            string body = orderByExpression.OrderByExpressionType == DbOrderByExpressionType.Ascending
                              ? "{0} ASC"
                              : "{0} DESC";
            string syntax = string.Format(body, Visit(orderByExpression.Expression));

            return(ExpressionFactory.Sql(syntax));
        }
        /// <summary>
        /// Translates the <paramref name="orderByExpression"/> into a string representation.
        /// </summary>
        /// <param name="orderByExpression">The <see cref="DbOrderByExpression"/> to translate.</param>
        /// <returns><see cref="DbExpression"/></returns>
        protected virtual DbExpression VisitOrderByExpression(DbOrderByExpression orderByExpression)
        {
            var expression = Visit(orderByExpression.Expression);

            if (!ReferenceEquals(expression, orderByExpression.Expression))
            {
                return(ExpressionFactory.MakeOrderBy(orderByExpression.OrderByExpressionType, expression));
            }

            return(orderByExpression);
        }
 /// <summary>
 /// Creates a new <see cref="DbOrderByExpression"/> that represents ordering the result set.
 /// </summary>
 /// <param name="orderByExpressionType">The <see cref="DbOrderByExpressionType"/> that specifies the ordering direction.</param>
 /// <param name="expression">The <see cref="DbExpression"/> representing an element in the 'ORDER BY' clause.</param>        
 /// <returns>A <see cref="DbOrderByExpression"/> instance.</returns>        
 public DbOrderByExpression MakeOrderBy(DbOrderByExpressionType orderByExpressionType, DbExpression expression)
 {
     var dbOrderByExpression = new DbOrderByExpression
                               { OrderByExpressionType = orderByExpressionType, Expression = expression };
     return dbOrderByExpression;
 }
 /// <summary>
 /// Translates the <paramref name="orderByExpression"/> into a string representation.
 /// </summary>
 /// <param name="orderByExpression">The <see cref="DbOrderByExpression"/> to translate.</param>
 /// <returns><see cref="string"/></returns>
 protected override DbExpression VisitOrderByExpression(DbOrderByExpression orderByExpression)
 {
     string body = orderByExpression.OrderByExpressionType == DbOrderByExpressionType.Ascending
                       ? "{0} ASC"
                       : "{0} DESC";
     string syntax = string.Format(body, Visit(orderByExpression.Expression));
     return ExpressionFactory.Sql(syntax);
 }
        /// <summary>
        /// Translates the <paramref name="orderByExpression"/> into a string representation.
        /// </summary>
        /// <param name="orderByExpression">The <see cref="DbOrderByExpression"/> to translate.</param>
        /// <returns><see cref="DbExpression"/></returns>
        protected virtual DbExpression VisitOrderByExpression(DbOrderByExpression orderByExpression)
        {
            var expression = Visit(orderByExpression.Expression);
            if (!ReferenceEquals(expression,orderByExpression.Expression))
                return ExpressionFactory.MakeOrderBy(orderByExpression.OrderByExpressionType, expression);

            return orderByExpression;
        }