This documentation is archived and is not being maintained.

DataContractJsonSerializer Constructor

Initializes a new instance of the DataContractJsonSerializer class.

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

  NameDescription
Public method DataContractJsonSerializer(Type) Initializes a new instance of the DataContractJsonSerializer class to serialize or deserialize an object of the specified type.
Public method DataContractJsonSerializer(Type, IEnumerable<Type>) Initializes a new instance of the DataContractJsonSerializer class to serialize or deserialize an object of the specified type, with a collection of known types that may be present in the object graph.
Public method DataContractJsonSerializer(Type, String) Initializes a new instance of the DataContractJsonSerializer class to serialize or deserialize an object of a specified type using the XML root element specified by a parameter.
Public method DataContractJsonSerializer(Type, XmlDictionaryString) Initializes a new instance of the DataContractJsonSerializer class to serialize or deserialize an object of a specified type using the XML root element specified by a parameter of type XmlDictionaryString.
Public method DataContractJsonSerializer(Type, String, IEnumerable<Type>) Initializes a new instance of the DataContractJsonSerializer class to serialize or deserialize an object of a specified type using the XML root element specified by a parameter, with a collection of known types that may be present in the object graph.
Public method DataContractJsonSerializer(Type, XmlDictionaryString, IEnumerable<Type>) Initializes a new instance of the DataContractJsonSerializer class to serialize or deserialize an object of a specified type using the XML root element specified by a parameter of type XmlDictionaryString, with a collection of known types that may be present in the object graph.
Public method DataContractJsonSerializer(Type, IEnumerable<Type>, Int32, Boolean, IDataContractSurrogate, Boolean) Initializes a new instance of the DataContractJsonSerializer 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 or deserialize, whether to ignore unexpected data or emit type information, and a surrogate for custom serialization.
Public method DataContractJsonSerializer(Type, String, IEnumerable<Type>, Int32, Boolean, IDataContractSurrogate, Boolean) Initializes a new instance of the DataContractJsonSerializer class to serialize or deserialize an object of the specified type. This method also specifies the root name of the XML element, a list of known types that may be present in the object graph, the maximum number of graph items to serialize or deserialize, whether to ignore unexpected data or emit type information, and a surrogate for custom serialization.
Public method DataContractJsonSerializer(Type, XmlDictionaryString, IEnumerable<Type>, Int32, Boolean, IDataContractSurrogate, Boolean) Initializes a new instance of the DataContractJsonSerializer class to serialize or deserialize an object of the specified type. This method also specifies the root name of the XML element, a list of known types that may be present in the object graph, the maximum number of graph items to serialize or deserialize, whether to ignore unexpected data or emit type information, and a surrogate for custom serialization.
Top

ExceptionCondition
InvalidDataContractException

At least one of the types being serialized or deserialized does not conform to data contract rules. For example, the DataContractAttribute attribute has not been applied to the type.

Show: