I have a JSON response which looks like this:
{
"success": true,
"more": false,
"results_html": "a lot of html in here",
"listinginfo": {
"637640274112277168": {
"listingid": "637640274112277168",
"price": 50,
"fee": 7,
"publisher_fee_app": 730,
"publisher_fee_percent": "0.10000000149011612",
"currencyid": "2005",
"steam_fee": 2,
"publisher_fee": 5,
"converted_price": 1,
"converted_fee": 2,
"converted_currencyid": "2003",
"converted_steam_fee": 1,
"converted_publisher_fee": 1,
"converted_price_per_unit": 1,
"converted_fee_per_unit": 2,
"converted_steam_fee_per_unit": 1,
"converted_publisher_fee_per_unit": 1,
"asset": {
"currency": 0,
"appid": 730,
"contextid": "2",
"id": "6542776191",
"amount": "1"
}
},
"194035710805671301": {
"listingid": "194035710805671301",
"price": 0,
"fee": 0,
"publisher_fee_app": 730,
"publisher_fee_percent": "0.10000000149011612",
"currencyid": "2001",
"asset": {
"currency": 0,
"appid": 730,
"contextid": "2",
"id": "6825071309",
"amount": "0"
}
},
}//end listinginfo
//more fields here..
}
I Need to get the info just from the "listinginfo" node and add them to a dictionary<string, NewListedItem>
where string would be for example: "637640274112277168", and the list will be of type "NewListedItem", containing all the info from that subnode. My classes look like that:
class listinginfo
{
public Dictionary<string, NewListedItem> Items;
}
class Asset
{
public string currency { get; set; }
public string appid { get; set; }
public string contextid { get; set; }
public string id { get; set; }
public string amount { get; set; }
}
class NewListedItem
{
public string listingid { get; set; }
public string price { get; set; }
public string fee { get; set; }
public string publisher_fee_app { get; set; }
public string publisher_fee_percent { get; set; }
public string steam_fee { get; set; }
public string publisher_fee { get; set; }
public string converted_price { get; set; }
public string converted_fee { get; set; }
public string converted_currencyid { get; set; }
public string converted_steam_fee { get; set; }
public string converted_publisher_fee { get; set; }
public string converted_fee_per_unit { get; set; }
public string converted_steam_fee_per_unit { get; set; }
public string converted_publisher_fee_per_unit { get; set; }
public Asset asset { get; set; }
}
How can i achieve this?