C#C
C#3y ago
Scythe

❔ Sorting a JObject by child values

I have JSON being returned by an API that I'm trying to sort to find the most relevant result. Here's an example of the JSON

{
    "data": {
        "total": 2,
        "tracks": [
            {
                "id": 170778,
                "type": "0",
                "title": "Wicked Wonders",
                "playCount": 0,
                "rating": 0,
                "tags": []
            },
            {
                "id": 210755,
                "type": "0",
                "title": "The Wonders Of The Universe",
                "playCount": 1,
                "rating": 3,
                "tags": []
            }
        ]
    }
}


I need to work out which track is the most relevant which I was going to by comparing/sorting by playCount/rating values (So Wonders of the universe would be the preferred result above) but I'm struggling to find a good way to sort the track array by the child values.

Can someone point me in the right direction?
Was this page helpful?