0
IM使用json.net如何獲取json源的反序列化對象? json.net
JSON的反序列化到對象後,我想這個對象
例如JSON的來源
objParent:{
objChild1: {name:"testObj"},
objChild2: {age: 25}
}
在C#代碼
public ObjChild1
{
public string name {get;set;}
[JsonIgnore]
public string JsonSource { get; set; } //objChild1: {name:"testObj"}
}
public ObjChild2
{
public int age {get;set;}
[JsonIgnore]
public string JsonSource { get; set; } //objChild2: {age: 25}
}