我正在使用 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}
}