Provides the methods needed to substitute one type for another by the DataContractSerializer during serialization, deserialization, and export and import of XML schema documents (XSD).
Assembly: System.Runtime.Serialization (in System.Runtime.Serialization.dll)
Use the when using the DataContractSerializer if you need to do one of the following: substitute one type or object for another, or to dynamically generate schema variations. For a sample application, see DataContract Surrogate Sample. For more information about data contracts, see Using Data Contracts.
At run time, you can find the specific DataContractSerializer for any operation in a service by using the OperationDescription to find the DataContractSerializerOperationBehavior instance. For more information about implementing the interface to create a surrogate, see Data Contract Surrogates.
You can also use the to affect the import and export of XML schemas when you are using the XsdDataContractExporter and XsdDataContractImporter classes. You can do so by assigning the to the DataContractSurrogate property of the ExportOptions class, or to the DataContractSurrogate property of the ImportOptions class. For more information, see Schema Import and Export.
Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003
The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.