Using the following example is it possible to use the AddChild Setter method in Json.Net during Deserialization to populate the list of children?
public class Foo
{
private IList<Foo> _children;
private Foo _parent;
public Foo()
{
_children = new List<Foo>();
}
public string Name { get; set; }
public IEnumerable<Foo> Children
{
get { return _children.AsEnumerable() }
}
public void AddChild(Foo child)
{
child._parent = this;
_children.Add(child);
}
}