I'm trying to translate the JSON object I get back from an API call to a C# class which I can in turn iterate over, however the JSON I can't seem to decipher the JSON correctly. JSON Object Sample:
"status": "ok",
"meta": {
"count": 1,
"hidden": null
},
"data": {
"111111111": [
{
"ship_id": 4180588496
},
{
"ship_id": 4284430032
},
{
"ship_id": 3767482320
}
]
}
}
It's primarily the fact that under Data the Object has a different name for every call I make since it's the Player ID of the player I am requesting data on. In essence I want to be able to iterate over the data in the '1111111' class. I have no clue how to proceed anymore, I tried receiving a list of Interfaces that have the ship_id, I tried generating classes from JSON to C# but now I'm completely out of ideas. Any help would be appreciated. My current setup of receiving classes looks like this:
public class WgShipRequest
{
public string Status { get; set; }
public WgPlayerShip Data { get; set; }
}
public class WgPlayerShip
{
public IList<WgShipId> Ships { get; set; }
}
public class WgShipId
{
public long Ship_Id { get; set; }
}