protected virtual DbSortClause VisitSortClause(DbSortClause clause)
        {
            var result = clause;

            if (clause != null)
            {
                var newExpression = VisitExpression(clause.Expression);
                if (!ReferenceEquals(clause.Expression, newExpression))
                {
                    if (!string.IsNullOrEmpty(clause.Collation))
                    {
                        result = (clause.Ascending
                                      ? CqtBuilder.ToSortClause(newExpression, clause.Collation)
                                      : CqtBuilder.ToSortClauseDescending(newExpression, clause.Collation));
                    }
                    else
                    {
                        result = (clause.Ascending
                                      ? CqtBuilder.ToSortClause(newExpression)
                                      : CqtBuilder.ToSortClauseDescending(newExpression));
                    }
                }
            }
            return(result);
        }