Determines how objects are serialized by default, IsReference=false .
Setting IsReference = true allows you to serialize object trees that can refer to each other. So, with a list of Employees , each of which has a property for Manager (who is also an Employee ), a reference to Manager for each Employee can be stored rather than embed a Manager inside each Employee node:
IsReference=false will create:
<Employee> <Manager i:nil="true" /> <Name>Kenny</Name> </Employee> <Employee> <Manager> <Manager i:nil="true" /> <Name>Kenny</Name> </Manager> <Name>Bob</Name> </Employee> <Employee> <Manager> <Manager i:nil="true" /> <Name>Kenny</Name> </Manager> <Name>Alice</Name> </Employee>
Where as IsReference=true will be produced:
<Employee z:Id="i1" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/"> <Manager i:nil="true" /> <Name>Kenny</Name> </Employee> <Employee z:Id="i2" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/"> <Manager z:Ref="i1" /> <Name>Bob</Name> </Employee> <Employee z:Id="i3" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/"> <Manager z:Ref="i1" /> <Name>Alice</Name> </Employee>
Fragments taken from this weblog , which has a full explanation along with examples of generated XML with the property applied.
The MSDN - IsReference Property contains detailed information as well as Interactive Object References .
Tanner Jun 24 '09 at 12:05 2009-06-24 12:05
source share