Skip to content

Commit

Permalink
Fixing bug with orderby
Browse files Browse the repository at this point in the history
closes #643
  • Loading branch information
belav committed Apr 11, 2022
1 parent e94e002 commit 22b144f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ class ClassName

var whereQuery = from c in customers where c.Value == "true" select d;

var orderByQuery =
from c in customers
where c.Value == "true"
orderby c.FirstProperty, c.SecondProperty descending
select d;

var complexWhere =
from c in customers
where
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@ internal static class OrderByClause
public static Doc Print(OrderByClauseSyntax node)
{
return Doc.Concat(
Token.PrintWithSuffix(node.OrderByKeyword, " "),
Token.Print(node.OrderByKeyword),
SeparatedSyntaxList.Print(
node.Orderings,
orderingNode =>
Doc.Concat(
Node.Print(orderingNode.Expression),
" ",
Node.Print(orderingNode.Expression),
string.IsNullOrEmpty(orderingNode.AscendingOrDescendingKeyword.Text)
? Doc.Null
: " ",
Token.Print(orderingNode.AscendingOrDescendingKeyword)
),
Doc.Null
Expand Down

0 comments on commit 22b144f

Please sign in to comment.