Stores data from a versioned data contract that has been extended by adding new members.
Assembly: System.Runtime.Serialization (in System.Runtime.Serialization.dll)
Thetype exposes the following members.
|Equals(Object)||Determines whether the specified object is equal to the current object. (Inherited from Object.)|
|GetHashCode||Serves as the default hash function. (Inherited from Object.)|
|GetType||Gets the Type of the current instance. (Inherited from Object.)|
|ToString||Returns a string that represents the current object. (Inherited from Object.)|
The is the structure that stores extra data encountered by the XmlObjectSerializer during deserialization operations. The structure is used by serialization to write the extra data into the serialized instance. The structure is returned by the ExtensionData property of the IExtensibleDataObject interface.
The following code serializes an instance of a type (PersonVersion2) that is the second version of the serializable type (Person). The second version contains extra data (ID field) that is not present in the first version. The code then deserializes the XML document into a Person object, then immediately reserializes the object including the extra data. Finally, the code deserializes the new XML into a PersonVersion2 object and writes the complete data to the console, proving that the data has made a round trip to and from an older version of the type. Note that the DataContractAttribute attribute must be applied with the Name and Namespace properties set to the same name and namespace as the original class.