Export (0) Print
Expand All
Expand Minimize

DataContractSerializer Constructor

Initializes a new instance of the DataContractSerializer class.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

  Name Description
Public method DataContractSerializer(Type) Initializes a new instance of the DataContractSerializer class to serialize or deserialize an object of the specified type.
Public method DataContractSerializer(Type, IEnumerable<Type>) Initializes a new instance of the DataContractSerializer class to serialize or deserialize an object of the specified type, and a collection of known types that may be present in the object graph.
Public method DataContractSerializer(Type, DataContractSerializerSettings) Initializes a new instance of the DataContractSerializer class to serialize or deserialize an object of the specified type and settings.
Public method DataContractSerializer(Type, String, String) Initializes a new instance of the DataContractSerializer class to serialize or deserialize an object of the specified type using the supplied XML root element and namespace.
Public method DataContractSerializer(Type, XmlDictionaryString, XmlDictionaryString) Initializes a new instance of the DataContractSerializer class to serialize or deserialize an object of the specified type using the XML root element and namespace specified through the parameters of type XmlDictionaryString.
Public method DataContractSerializer(Type, String, String, IEnumerable<Type>) Initializes a new instance of the DataContractSerializer class to serialize or deserialize an object of the specified type. This method also specifies the root XML element and namespace in two string parameters as well as a list of known types that may be present in the object graph.
Public method DataContractSerializer(Type, XmlDictionaryString, XmlDictionaryString, IEnumerable<Type>) Initializes a new instance of the DataContractSerializer class to serialize or deserialize an object of the specified type. This method also specifies the root XML element and namespace in two XmlDictionaryString parameters as well as a list of known types that may be present in the object graph.
Public method DataContractSerializer(Type, IEnumerable<Type>, Int32, Boolean, Boolean, IDataContractSurrogate) Initializes a new instance of the DataContractSerializer class to serialize or deserialize an object of the specified type. This method also specifies a list of known types that may be present in the object graph, the maximum number of graph items to serialize, parameters to ignore unexpected data, whether to use non-standard XML constructs to preserve object reference data in the graph, and a surrogate for custom serialization.
Public method DataContractSerializer(Type, IEnumerable<Type>, Int32, Boolean, Boolean, IDataContractSurrogate, DataContractResolver) Initializes a new instance of the DataContractSerializer class to serialize or deserialize an object of the specified type. This method also specifies a list of known types that may be present in the object graph, the maximum number of graph items to serialize, parameters to ignore unexpected data, whether to use non-standard XML constructs to preserve object reference data in the graph, a surrogate for custom serialization, and an alternative for mapping xsi:type declarations at run time.
Public method DataContractSerializer(Type, String, String, IEnumerable<Type>, Int32, Boolean, Boolean, IDataContractSurrogate) Initializes a new instance of the DataContractSerializer class to serialize or deserialize an object of the specified type. This method also specifies a list of known types that may be present in the object graph, the maximum number of graph items to serialize, parameters to ignore unexpected data, whether to use non-standard XML constructs to preserve object reference data in the graph, a surrogate for custom serialization, and the XML element and namespace that contain the content.
Public method DataContractSerializer(Type, XmlDictionaryString, XmlDictionaryString, IEnumerable<Type>, Int32, Boolean, Boolean, IDataContractSurrogate) Initializes a new instance of the DataContractSerializer class to serialize or deserialize an object of the specified type. This method also specifies a list of known types that may be present in the object graph, the maximum number of graph items to serialize, parameters to ignore unexpected data, whether to use non-standard XML constructs to preserve object reference data in the graph, a surrogate for custom serialization, and parameters of XmlDictionaryString that specify the XML element and namespace that contain the content.
Public method DataContractSerializer(Type, String, String, IEnumerable<Type>, Int32, Boolean, Boolean, IDataContractSurrogate, DataContractResolver) Initializes a new instance of the DataContractSerializer class to serialize or deserialize an object of the specified type. This method also specifies a list of known types that may be present in the object graph, the maximum number of graph items to serialize, parameters to ignore unexpected data, whether to use non-standard XML constructs to preserve object reference data in the graph, a surrogate for custom serialization, the XML element and namespace that contains the content, and an alternative for mapping xsi:type declarations at run time.
Public method DataContractSerializer(Type, XmlDictionaryString, XmlDictionaryString, IEnumerable<Type>, Int32, Boolean, Boolean, IDataContractSurrogate, DataContractResolver) Initializes a new instance of the DataContractSerializer class to serialize or deserialize an object of the specified type. This method also specifies a list of known types that may be present in the object graph, the maximum number of graph items to serialize, parameters to ignore unexpected data, whether to use non-standard XML constructs to preserve object reference data in the graph, a surrogate for custom serialization, parameters of XmlDictionaryString that specify the XML element and namespace that contains the content, and an alternative for mapping xsi:type declarations at run time.
Top

Exception Condition
InvalidDataContractException

The type being serialized does not conform to data contract rules. For example, the DataContractAttribute attribute has not been applied to the type.

Show:
© 2014 Microsoft