Here is an example snippet of the json data that the API returns:
{
"realm":{"name":"Molten Core","slug":"molten-core"},
"auctions":{"auctions":[
{"auc":1880591075,"item":109128,"owner":"Leagra","ownerRealm":"Azjol-Nerub","bid":858600,"buyout":900000,"quantity":100,"timeLeft":"VERY_LONG","rand":0,"seed":0,"context":0},
{"auc":1879726534,"item":43115,"owner":"Nêwt","ownerRealm":"Azjol-Nerub","bid":5120000,"buyout":5120000,"quantity":16,"timeLeft":"VERY_LONG","rand":0,"seed":835268864,"context":0}]}
}
(Though obviously with real data there's thousands of auctions.)
I'm looking to deserialise this, ignoring the realm data and just putting the auctions into a nice clean List<WowAuction>
object, with WowAuction
being:
public class WowAuction
{
public long auc { get; set; }
public long item { get; set; }
public long bid { get; set; }
public long buyout { get; set; }
}
I'm having trouble wrapping my head around how I would do this, the json the API returns seems rather messy to me (though admittedly I haven't worked with json before).
As far as I can tell, there's a collection called "auctions", inside of that is a single field also called "auctions" which is a table, that table then contains rows of auction data. How would I deserialise this?