How to parse JSON objects with numeric keys using JavaScriptSerializer

后端 未结 2 1181
旧巷少年郎
旧巷少年郎 2021-01-22 08:39

I have an object like below to be deserialized in C#. I am wondering how I can parse it. I tried following this example here, but am stumped on how I can get my class to recog

2条回答
  •  攒了一身酷
    2021-01-22 09:05

    It can be done with the JObject in JSON.Net library.

    var transactions = JObject.Parse(json).PropertyValues()
                                          .Select(o => o.ToObject());
    

    This should do the trick.

提交回复
热议问题