I am trying to convert below JSON object to C# class. I could able to get C# equivalent for filter, but not for sort.
In the case of filter JSON object; andOr, openCondition, etc are static. Hence, I could able to generate C# class.
But for sort JSON object; accountName, and tradeDate are not static. These fields are completely as per user requirement. They may change as some other fields for some other input. Hence, I'm not understanding how can I generate C# class for this sort JSON object. Can anyone please suggest me how to do this?
{
"filter": [
{
"andOr": "",
"openCondition": false,
"columnName": "accountName",
"operator": "eq",
"value": "KATHERINE",
"closeCondition": false
}
],
"sort": {
"accountName": "asc",
"tradeDate": "desc"
},
"pageIndex": 1,
"pageSize": 75
}
I have tried to create SortCriteria class like below. But, it is not matching to the JSON sort object.
public class SortCriteria
{
public string ColumnName { get; set; }
public string SortOrder { get; set; }
}
Can anyone please suggest me how can I solve this issue.
