DataContractJsonSerializer DataContractJsonSerializer DataContractJsonSerializer Constructors

Definition

Overloads

DataContractJsonSerializer(Type) DataContractJsonSerializer(Type) DataContractJsonSerializer(Type)

Initializes a new instance of the DataContractJsonSerializer class to serialize or deserialize an object of the specified type.

DataContractJsonSerializer(Type, IEnumerable<Type>) DataContractJsonSerializer(Type, IEnumerable<Type>) 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.

DataContractJsonSerializer(Type, DataContractJsonSerializerSettings) DataContractJsonSerializer(Type, DataContractJsonSerializerSettings) DataContractJsonSerializer(Type, DataContractJsonSerializerSettings)

Initializes a new instance of the DataContractJsonSerializer class to serialize or deserialize an object of the specified type and serializer settings.

DataContractJsonSerializer(Type, String) DataContractJsonSerializer(Type, String) 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.

DataContractJsonSerializer(Type, XmlDictionaryString) DataContractJsonSerializer(Type, XmlDictionaryString) 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.

DataContractJsonSerializer(Type, String, IEnumerable<Type>) DataContractJsonSerializer(Type, String, IEnumerable<Type>) 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.

DataContractJsonSerializer(Type, XmlDictionaryString, IEnumerable<Type>) DataContractJsonSerializer(Type, XmlDictionaryString, IEnumerable<Type>) 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.

DataContractJsonSerializer(Type, IEnumerable<Type>, Int32, Boolean, IDataContractSurrogate, Boolean) DataContractJsonSerializer(Type, IEnumerable<Type>, Int32, Boolean, IDataContractSurrogate, Boolean) 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.

DataContractJsonSerializer(Type, String, IEnumerable<Type>, Int32, Boolean, IDataContractSurrogate, Boolean) DataContractJsonSerializer(Type, String, IEnumerable<Type>, Int32, Boolean, IDataContractSurrogate, Boolean) 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.

DataContractJsonSerializer(Type, XmlDictionaryString, IEnumerable<Type>, Int32, Boolean, IDataContractSurrogate, Boolean) DataContractJsonSerializer(Type, XmlDictionaryString, IEnumerable<Type>, Int32, Boolean, IDataContractSurrogate, Boolean) 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.

DataContractJsonSerializer(Type) DataContractJsonSerializer(Type) DataContractJsonSerializer(Type)

Initializes a new instance of the DataContractJsonSerializer class to serialize or deserialize an object of the specified type.

public:
 DataContractJsonSerializer(Type ^ type);
public DataContractJsonSerializer (Type type);
new System.Runtime.Serialization.Json.DataContractJsonSerializer : Type -> System.Runtime.Serialization.Json.DataContractJsonSerializer

Parameters

type
Type Type Type

The type of the instances that is serialized or deserialized.

DataContractJsonSerializer(Type, IEnumerable<Type>) DataContractJsonSerializer(Type, IEnumerable<Type>) 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:
 DataContractJsonSerializer(Type ^ type, System::Collections::Generic::IEnumerable<Type ^> ^ knownTypes);
public DataContractJsonSerializer (Type type, System.Collections.Generic.IEnumerable<Type> knownTypes);
new System.Runtime.Serialization.Json.DataContractJsonSerializer : Type * seq<Type> -> System.Runtime.Serialization.Json.DataContractJsonSerializer

Parameters

type
Type Type Type

The type of the instances that are serialized or deserialized.

knownTypes
IEnumerable<Type>

An IEnumerable<T> of Type that contains the types that may be present in the object graph.

DataContractJsonSerializer(Type, DataContractJsonSerializerSettings) DataContractJsonSerializer(Type, DataContractJsonSerializerSettings) DataContractJsonSerializer(Type, DataContractJsonSerializerSettings)

Initializes a new instance of the DataContractJsonSerializer class to serialize or deserialize an object of the specified type and serializer settings.

public:
 DataContractJsonSerializer(Type ^ type, System::Runtime::Serialization::Json::DataContractJsonSerializerSettings ^ settings);
public DataContractJsonSerializer (Type type, System.Runtime.Serialization.Json.DataContractJsonSerializerSettings settings);
new System.Runtime.Serialization.Json.DataContractJsonSerializer : Type * System.Runtime.Serialization.Json.DataContractJsonSerializerSettings -> System.Runtime.Serialization.Json.DataContractJsonSerializer

Parameters

type
Type Type Type

The type of the instances that is serialized or deserialized.

DataContractJsonSerializer(Type, String) DataContractJsonSerializer(Type, String) 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:
 DataContractJsonSerializer(Type ^ type, System::String ^ rootName);
public DataContractJsonSerializer (Type type, string rootName);
new System.Runtime.Serialization.Json.DataContractJsonSerializer : Type * string -> System.Runtime.Serialization.Json.DataContractJsonSerializer

Parameters

type
Type Type Type

The type of the instances that is serialized or deserialized.

rootName
String String String

The name of the XML element that encloses the content to serialize or deserialize.

DataContractJsonSerializer(Type, XmlDictionaryString) DataContractJsonSerializer(Type, XmlDictionaryString) 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:
 DataContractJsonSerializer(Type ^ type, System::Xml::XmlDictionaryString ^ rootName);
public DataContractJsonSerializer (Type type, System.Xml.XmlDictionaryString rootName);
new System.Runtime.Serialization.Json.DataContractJsonSerializer : Type * System.Xml.XmlDictionaryString -> System.Runtime.Serialization.Json.DataContractJsonSerializer

Parameters

type
Type Type Type

The type of the instances that is serialized or deserialized.

rootName
XmlDictionaryString XmlDictionaryString XmlDictionaryString

An XmlDictionaryString that contains the root element name of the content.

DataContractJsonSerializer(Type, String, IEnumerable<Type>) DataContractJsonSerializer(Type, String, IEnumerable<Type>) 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:
 DataContractJsonSerializer(Type ^ type, System::String ^ rootName, System::Collections::Generic::IEnumerable<Type ^> ^ knownTypes);
public DataContractJsonSerializer (Type type, string rootName, System.Collections.Generic.IEnumerable<Type> knownTypes);
new System.Runtime.Serialization.Json.DataContractJsonSerializer : Type * string * seq<Type> -> System.Runtime.Serialization.Json.DataContractJsonSerializer

Parameters

type
Type Type Type

The type of the instances that is serialized or deserialized.

rootName
String String String

The name of the XML element that encloses the content to serialize or deserialize. The default is "root".

knownTypes
IEnumerable<Type>

An IEnumerable<T> of Type that contains the types that may be present in the object graph.

DataContractJsonSerializer(Type, XmlDictionaryString, IEnumerable<Type>) DataContractJsonSerializer(Type, XmlDictionaryString, IEnumerable<Type>) 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:
 DataContractJsonSerializer(Type ^ type, System::Xml::XmlDictionaryString ^ rootName, System::Collections::Generic::IEnumerable<Type ^> ^ knownTypes);
public DataContractJsonSerializer (Type type, System.Xml.XmlDictionaryString rootName, System.Collections.Generic.IEnumerable<Type> knownTypes);
new System.Runtime.Serialization.Json.DataContractJsonSerializer : Type * System.Xml.XmlDictionaryString * seq<Type> -> System.Runtime.Serialization.Json.DataContractJsonSerializer

Parameters

type
Type Type Type

The type of the instances that is serialized or deserialized.

rootName
XmlDictionaryString XmlDictionaryString XmlDictionaryString

An XmlDictionaryString that contains the root element name of the content.

knownTypes
IEnumerable<Type>

An IEnumerable<T> of Type that contains the types that may be present in the object graph.

DataContractJsonSerializer(Type, IEnumerable<Type>, Int32, Boolean, IDataContractSurrogate, Boolean) DataContractJsonSerializer(Type, IEnumerable<Type>, Int32, Boolean, IDataContractSurrogate, Boolean) 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:
 DataContractJsonSerializer(Type ^ type, System::Collections::Generic::IEnumerable<Type ^> ^ knownTypes, int maxItemsInObjectGraph, bool ignoreExtensionDataObject, System::Runtime::Serialization::IDataContractSurrogate ^ dataContractSurrogate, bool alwaysEmitTypeInformation);
public DataContractJsonSerializer (Type type, System.Collections.Generic.IEnumerable<Type> knownTypes, int maxItemsInObjectGraph, bool ignoreExtensionDataObject, System.Runtime.Serialization.IDataContractSurrogate dataContractSurrogate, bool alwaysEmitTypeInformation);
new System.Runtime.Serialization.Json.DataContractJsonSerializer : Type * seq<Type> * int * bool * System.Runtime.Serialization.IDataContractSurrogate * bool -> System.Runtime.Serialization.Json.DataContractJsonSerializer

Parameters

type
Type Type Type

The type of the instances that is serialized or deserialized.

knownTypes
IEnumerable<Type>

An XmlDictionaryString that contains the root element name of the content.

maxItemsInObjectGraph
Int32 Int32 Int32

An IEnumerable<T> of Type that contains the types that may be present in the object graph.

ignoreExtensionDataObject
Boolean Boolean Boolean

true to ignore the IExtensibleDataObject interface upon serialization and ignore unexpected data upon deserialization; otherwise, false. The default is false.

dataContractSurrogate
IDataContractSurrogate IDataContractSurrogate IDataContractSurrogate

An implementation of the IDataContractSurrogate to customize the serialization process.

alwaysEmitTypeInformation
Boolean Boolean Boolean

true to emit type information; otherwise, false. The default is false.

DataContractJsonSerializer(Type, String, IEnumerable<Type>, Int32, Boolean, IDataContractSurrogate, Boolean) DataContractJsonSerializer(Type, String, IEnumerable<Type>, Int32, Boolean, IDataContractSurrogate, Boolean) 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:
 DataContractJsonSerializer(Type ^ type, System::String ^ rootName, System::Collections::Generic::IEnumerable<Type ^> ^ knownTypes, int maxItemsInObjectGraph, bool ignoreExtensionDataObject, System::Runtime::Serialization::IDataContractSurrogate ^ dataContractSurrogate, bool alwaysEmitTypeInformation);
public DataContractJsonSerializer (Type type, string rootName, System.Collections.Generic.IEnumerable<Type> knownTypes, int maxItemsInObjectGraph, bool ignoreExtensionDataObject, System.Runtime.Serialization.IDataContractSurrogate dataContractSurrogate, bool alwaysEmitTypeInformation);
new System.Runtime.Serialization.Json.DataContractJsonSerializer : Type * string * seq<Type> * int * bool * System.Runtime.Serialization.IDataContractSurrogate * bool -> System.Runtime.Serialization.Json.DataContractJsonSerializer

Parameters

type
Type Type Type

The type of the instances that is serialized or deserialized.

rootName
String String String

The name of the XML element that encloses the content to serialize or deserialize. The default is "root".

knownTypes
IEnumerable<Type>

An IEnumerable<T> of Type that contains the types that may be present in the object graph.

maxItemsInObjectGraph
Int32 Int32 Int32

The maximum number of items in the graph to serialize or deserialize. The default is the value returned by the MaxValue property.

ignoreExtensionDataObject
Boolean Boolean Boolean

true to ignore the IExtensibleDataObject interface upon serialization and ignore unexpected data upon deserialization; otherwise, false. The default is false.

dataContractSurrogate
IDataContractSurrogate IDataContractSurrogate IDataContractSurrogate

An implementation of the IDataContractSurrogate to customize the serialization process.

alwaysEmitTypeInformation
Boolean Boolean Boolean

true to emit type information; otherwise, false. The default is false.

DataContractJsonSerializer(Type, XmlDictionaryString, IEnumerable<Type>, Int32, Boolean, IDataContractSurrogate, Boolean) DataContractJsonSerializer(Type, XmlDictionaryString, IEnumerable<Type>, Int32, Boolean, IDataContractSurrogate, Boolean) 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.

public:
 DataContractJsonSerializer(Type ^ type, System::Xml::XmlDictionaryString ^ rootName, System::Collections::Generic::IEnumerable<Type ^> ^ knownTypes, int maxItemsInObjectGraph, bool ignoreExtensionDataObject, System::Runtime::Serialization::IDataContractSurrogate ^ dataContractSurrogate, bool alwaysEmitTypeInformation);
public DataContractJsonSerializer (Type type, System.Xml.XmlDictionaryString rootName, System.Collections.Generic.IEnumerable<Type> knownTypes, int maxItemsInObjectGraph, bool ignoreExtensionDataObject, System.Runtime.Serialization.IDataContractSurrogate dataContractSurrogate, bool alwaysEmitTypeInformation);
new System.Runtime.Serialization.Json.DataContractJsonSerializer : Type * System.Xml.XmlDictionaryString * seq<Type> * int * bool * System.Runtime.Serialization.IDataContractSurrogate * bool -> System.Runtime.Serialization.Json.DataContractJsonSerializer

Parameters

type
Type Type Type

The type of the instances that are serialized or deserialized.

rootName
XmlDictionaryString XmlDictionaryString XmlDictionaryString

An XmlDictionaryString that contains the root element name of the content.

knownTypes
IEnumerable<Type>

An IEnumerable<T> of Type that contains the known types that may be present in the object graph.

maxItemsInObjectGraph
Int32 Int32 Int32

The maximum number of items in the graph to serialize or deserialize. The default is the value returned by the MaxValue property.

ignoreExtensionDataObject
Boolean Boolean Boolean

true to ignore the IExtensibleDataObject interface upon serialization and ignore unexpected data upon deserialization; otherwise, false. The default is false.

dataContractSurrogate
IDataContractSurrogate IDataContractSurrogate IDataContractSurrogate

An implementation of the IDataContractSurrogate to customize the serialization process.

alwaysEmitTypeInformation
Boolean Boolean Boolean

true to emit type information; otherwise, false. The default is false.

Applies to