Deserializing JSON using JSon.NET with dynamic data

前端 未结 6 1500
被撕碎了的回忆
被撕碎了的回忆 2020-11-28 11:18

I\'m trying to deserialize some JSON data into objects for an application. Up until now it\'s been fine because the properties on the JSON data was static (key with a value)

6条回答
  •  隐瞒了意图╮
    2020-11-28 11:58

    Using Json.net you can just do:

    Dictionary result = JsonConvert.DeserializeObject>(json);
    foreach(var item in result)
        Console.WriteLine(item.Key + " " + item.Value);
    

提交回复
热议问题