Many times I have an object graph (root Object with properties which are collections of objects which in turn have... a.s.o.).
Often these are represented as xml files with a structure similar to:
<Root attr1="something">
<Children>
<Child name="First child">
<GrandChildren>
<GrandChild name="First grandchild"/>
<GrandChild name="Second grandchild"/>
</GrandChildren>
<Child name="Second root child">
:
:
Then often each of the entities needs to refer it's "owner" or "parent" Object (e.g. GrandChild needs to refer it's parent which is an instance of Child and so on) (Down to a much deeper Level than indicated above.
Assume that the entity classes all have a property called parent or owner and I would like to get this one filled during DeSerializing the xml document, is it possible to "hook into" the serializer from the parameterless constructor or something like that to set the owner/parent Properties ?