Just a question of curiosity. When i preserve object refernces while serializing an object graph with DataContractSerializer the xml emitted where there are refrences looks like this:
<test z:Ref="1" and i:nil="true" />
Can anybody tell me why it says i:nil=”true” here? Why not just the reference?
This is because the content of the
testelement is empty.i:nil="true"is necessary so that the content will validate.