Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "2": {
- "sell_average": 239,
- "buy_average": 238,
- "overall_average": 240,
- "id": 2
- },
- "6": {
- "sell_average": 184434,
- "buy_average": 182151,
- "overall_average": 189000,
- "id": 6
- },
- "8": {
- "sell_average": 11201,
- "buy_average": 1723,
- "overall_average": 180,
- "id": 8
- }
- }
- public class ItemSummaryModel
- {
- public string Id { get; set; }
- public ItemSummary ItemSummary { get; set; }
- }
- public class ItemSummary
- {
- public int Sell_Average { get; set; }
- public int Buy_Average { get; set; }
- public int Overall_Average { get; set; }
- public int Id { get; set; }
- }
- List<ItemSummaryModel> models =
- JsonConvert.DeserializeObject<List<ItemSummaryModel>>(jsonSummary);
- var dict = JsonConvert.DeserializeObject<Dictionary<int, ItemSummary>>(json);
- var items = dict.Values.ToList(); //if you want a List<ItemSummary>;
- public class ItemSummaryModel
- {
- [JsonProperty(PropertyName = "2")]
- public ItemSummary Two { get; set; }
- [JsonProperty(PropertyName = "6")]
- public ItemSummary Six { get; set; }
- [JsonProperty(PropertyName = "8")]
- public ItemSummary Eight { get; set; }
- }
- var result = JsonConvert.DeserializeObject<ItemSummaryModel>(json);
Add Comment
Please, Sign In to add comment