XmlMediaTypeFormatter.SetSerializer<T> Method (XmlSerializer)
Registers an XmlSerializer to read or write objects of a specified type.
Namespace: System.Net.Http.Formatting
Assembly: System.Net.Http.Formatting (in System.Net.Http.Formatting.dll)
Syntax
'Declaration
Public Sub SetSerializer(Of T) ( _
serializer As XmlSerializer _
)
'Usage
Dim instance As XmlMediaTypeFormatter
Dim serializer As XmlSerializer
instance.SetSerializer(serializer)
public void SetSerializer<T>(
XmlSerializer serializer
)
public:
generic<typename T>
void SetSerializer(
XmlSerializer^ serializer
)
member SetSerializer :
serializer:XmlSerializer -> unit
JScript does not support generic types and methods.
Type Parameters
- T
The type of object that will be serialized or deserialized withserializer.
Parameters
- serializer
Type: System.Xml.Serialization.XmlSerializer
The XmlSerializer instance.
Remarks
If no serializer is registered for a particular type, the XML formatter uses its default serializer. The default serializer is DataContractSerializer unless UseXmlSerializer is true.