We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent db3080f commit f856c47Copy full SHA for f856c47
ServiceNow.Api/ServiceNowClient.cs
@@ -247,9 +247,16 @@ internal async Task<List<JObject>> GetAllByQueryInternalJObjectAsync(
247
? _options.PagingFieldName
248
: customOrderByField;
249
250
- var orderByCommand = orderByField.StartsWith("-", StringComparison.Ordinal)
251
- ? "ORDERBYDESC"
252
- : "ORDERBY";
+ string orderByCommand;
+ if (orderByField?.StartsWith("-", StringComparison.Ordinal) ?? false)
+ {
253
+ orderByCommand = "ORDERBYDESC";
254
+ orderByField = orderByField.Substring(1);
255
+ }
256
+ else
257
258
+ orderByCommand = "ORDERBY";
259
260
261
_logger.LogTrace($"Entered {nameof(GetAllByQueryInternalJObjectAsync)}" +
262
$" type: {typeof(JObject)}" +
0 commit comments