Export (0) Print
Expand All

DataContractSerializer Constructor

Initializes a new instance of the DataContractSerializer class.

Exception type 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.

Name Description
DataContractSerializer (Type) Initializes a new instance of the DataContractSerializer class to serialize or deserialize an object of the specified type.
DataContractSerializer (Type, Generic IEnumerable) 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.
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.
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.
DataContractSerializer (Type, String, String, Generic IEnumerable) 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.
DataContractSerializer (Type, XmlDictionaryString, XmlDictionaryString, Generic IEnumerable) 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.
DataContractSerializer (Type, Generic IEnumerable, 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 or not to use non-standard XML constructs to preserve object reference data in the graph, and a surrogate for custom serialization.
DataContractSerializer (Type, String, String, Generic IEnumerable, 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 or not to use non-standard XML constructs to preserve object reference data in the graph, a surrogate for custom serialization, and strings that specify the XML element and namespace that contain the content.
DataContractSerializer (Type, XmlDictionaryString, XmlDictionaryString, Generic IEnumerable, 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 or not 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.

Community Additions

ADD
Show:
© 2014 Microsoft