我有这样的json
原文链接:https://www.f2er.com/json/288529.html{ "name": "somenameofevent","type": "event","data": { "object": { "age": "18","petName": "18" },"desct": { } } }
我有2个像这样的对象
public class CustEvent { [JsonProperty("name")] public string Name { get; set; } [JsonProperty("type")] public string EventType{ get; set; } [JsonProperty("data")] public SomeData Data{ get; set; } } public class SomeData { [JsonProperty("object")] public String SomeObject { get; set;} [JsonProperty("dsct")] public String SomeDesct { get; set; } }
我用来解析json对象Newtonsoft.NET库.以及如何将RAW JSON转换为SomeObject,SomeDesct属性?在JSON中,“data.object …”是复杂的对象,我想只获得RAW JSON String到这些属性.你可以帮我吗 ?