Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DataContractSerializer: preserve references

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?

like image 604
asgerhallas Avatar asked Dec 21 '25 09:12

asgerhallas


1 Answers

This is because the content of the test element is empty. i:nil="true" is necessary so that the content will validate.

like image 118
John Saunders Avatar answered Dec 23 '25 01:12

John Saunders



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!