I am trying to grab all elements from flat json. I am able to see the count of the multiple items but I am unable to see the values for each list property.
The JSON:
{
"Key":"C23432151461561",
"OrderId": 129012092109,
"SteamId":12341234321,
"AppId":1234132,
"ItemCount":2,
"Language":"en",
"Currency":"CAD",
"itemid[0]":1,
"qty[0]":2,
"amount[0]":12,
"description[0]":"majora's mask",
"itemid[1]":1,
"qty[1]":2,
"amount[1]":12,
"description[1]":"mario's hat",
}
Models
class Descriptions
{
public string descriptions { get; set; }
}
public class Amounts
{
public int amounts { get; set; }
}
public class Qtys
{
public int qtys { get; set; }
}
public class Items
{
public int itemids { get; set; }
}
public class InitTxn
{
public string key { get; set; }
public int orderid { get; set; }
public long steamid { get; set; }
public int appid { get; set; }
public int itemcount { get; set; }
public string language { get; set; }
public string currency { get; set; }
public List<Items> itemid { get; set; }
public List<Qtys> qty { get; set; }
public List<Amounts> amount { get; set; }
public List<Descriptions> description { get; set; }
}
Post Method
[System.Web.Http.HttpPost]
public string InitRequest([FromBody] InitTxn initTxn)
{}
I need to be able to see the values for the List properties. Thanks