Let say I have the following JSON
{
id: 5,
sub: {
id: 7
}
}
And my c# is defined as
public class outer {
public int id;
public inner sub;
public class inner {
private _outerRef;
public inner(outer outerRef) {
_outerRef = outerRef;
}
public int id;
public string name {
get {
return id + "." + _outerRef.id;
}
}
}
}
How can I de-serialize the JSON so that a reference to the outer class is passed along?
EDIT:
Technically, my c# class will be
public class outer {
public int id;
public List<inner> subs;
public class inner {
private _outerRef;
public inner(outer outerRef) {
_outerRef = outerRef;
}
public int id;
public string name {
get {
return id + "." + _outerRef.id;
}
}
}
}