Deserializing JSON array into strongly typed .NET object

前端 未结 8 760
一个人的身影
一个人的身影 2020-11-30 07:35

When I can call the 3rd party api and get back a single class worth of data everything deserialises fine using this code

TheUser me = jsonSerializer.Deseria         


        
8条回答
  •  悲哀的现实
    2020-11-30 07:41

    Json.NET - Documentation

    http://james.newtonking.com/json/help/index.html?topic=html/SelectToken.htm

    Interpretation for the author

    var o = JObject.Parse(response);
    var a = o.SelectToken("data").Select(jt => jt.ToObject()).ToList();
    

提交回复
热议问题