Skip to content

Commit ecb04c8

Browse files
committed
Clarify ternary operation by assigning a variable
1 parent 47cffd1 commit ecb04c8

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

Postgrest/Table.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -668,13 +668,18 @@ public string GenerateUrl()
668668

669669
if (order.Length > 0)
670670
order.Append(",");
671-
order.Append($"{(!string.IsNullOrEmpty(orderer.ForeignTable) ? orderer.ForeignTable + "(" + orderer.Column + ")" : orderer.Column)}.{orderingAttr.Mapping}.{nullPosAttr.Mapping}");
671+
672+
var selector = !string.IsNullOrEmpty(orderer.ForeignTable)
673+
? orderer.ForeignTable + "(" + orderer.Column + ")"
674+
: orderer.Column;
675+
676+
order.Append($"{selector}.{orderingAttr.Mapping}.{nullPosAttr.Mapping}");
672677
}
673678

674-
query.Add("order", order.ToString());
675-
}
679+
query.Add("order", order.ToString());
680+
}
676681

677-
if (!string.IsNullOrEmpty(_columnQuery))
682+
if (!string.IsNullOrEmpty(_columnQuery))
678683
query["select"] = Regex.Replace(_columnQuery!, @"\s", "");
679684

680685
if (_references.Count > 0)

0 commit comments

Comments
 (0)