DataContractJsonSerializer Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Initializes a new instance of the DataContractJsonSerializer class.
Overloads
| Name | Description |
|---|---|
| DataContractJsonSerializer(Type) |
Initializes a new instance of the DataContractJsonSerializer class to serialize or deserialize an object of the specified 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) |
Initializes a new instance of the DataContractJsonSerializer class to serialize or deserialize an object of the specified type and serializer settings. |
| 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) |
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>) |
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>) |
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)
Initializes a new instance of the DataContractJsonSerializer class to serialize or deserialize an object of the specified type.
public:
DataContractJsonSerializer(Type ^ type);
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")]
public DataContractJsonSerializer(Type type);
public DataContractJsonSerializer(Type type);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")]
public DataContractJsonSerializer(Type type);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed.")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")>]
new System.Runtime.Serialization.Json.DataContractJsonSerializer : Type -> System.Runtime.Serialization.Json.DataContractJsonSerializer
new System.Runtime.Serialization.Json.DataContractJsonSerializer : Type -> System.Runtime.Serialization.Json.DataContractJsonSerializer
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")>]
new System.Runtime.Serialization.Json.DataContractJsonSerializer : Type -> System.Runtime.Serialization.Json.DataContractJsonSerializer
Public Sub New (type As Type)
Parameters
- type
- Type
The type of the instances that is serialized or deserialized.
- Attributes
Applies to
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);
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")]
public DataContractJsonSerializer(Type type, System.Collections.Generic.IEnumerable<Type>? knownTypes);
public DataContractJsonSerializer(Type type, System.Collections.Generic.IEnumerable<Type>? knownTypes);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")]
public DataContractJsonSerializer(Type type, System.Collections.Generic.IEnumerable<Type>? knownTypes);
public DataContractJsonSerializer(Type type, System.Collections.Generic.IEnumerable<Type> knownTypes);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed.")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")>]
new System.Runtime.Serialization.Json.DataContractJsonSerializer : Type * seq<Type> -> System.Runtime.Serialization.Json.DataContractJsonSerializer
new System.Runtime.Serialization.Json.DataContractJsonSerializer : Type * seq<Type> -> System.Runtime.Serialization.Json.DataContractJsonSerializer
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")>]
new System.Runtime.Serialization.Json.DataContractJsonSerializer : Type * seq<Type> -> System.Runtime.Serialization.Json.DataContractJsonSerializer
Public Sub New (type As Type, knownTypes As IEnumerable(Of Type))
Parameters
- 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.
- Attributes
Applies to
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);
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")]
public DataContractJsonSerializer(Type type, System.Runtime.Serialization.Json.DataContractJsonSerializerSettings? settings);
public DataContractJsonSerializer(Type type, System.Runtime.Serialization.Json.DataContractJsonSerializerSettings? settings);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")]
public DataContractJsonSerializer(Type type, System.Runtime.Serialization.Json.DataContractJsonSerializerSettings? settings);
public DataContractJsonSerializer(Type type, System.Runtime.Serialization.Json.DataContractJsonSerializerSettings settings);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed.")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")>]
new System.Runtime.Serialization.Json.DataContractJsonSerializer : Type * System.Runtime.Serialization.Json.DataContractJsonSerializerSettings -> System.Runtime.Serialization.Json.DataContractJsonSerializer
new System.Runtime.Serialization.Json.DataContractJsonSerializer : Type * System.Runtime.Serialization.Json.DataContractJsonSerializerSettings -> System.Runtime.Serialization.Json.DataContractJsonSerializer
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")>]
new System.Runtime.Serialization.Json.DataContractJsonSerializer : Type * System.Runtime.Serialization.Json.DataContractJsonSerializerSettings -> System.Runtime.Serialization.Json.DataContractJsonSerializer
Public Sub New (type As Type, settings As DataContractJsonSerializerSettings)
Parameters
- type
- Type
The type of the instances that is serialized or deserialized.
- settings
- DataContractJsonSerializerSettings
The serializer settings for the JSON serializer.
- Attributes
Applies to
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);
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")]
public DataContractJsonSerializer(Type type, string? rootName);
public DataContractJsonSerializer(Type type, string? rootName);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")]
public DataContractJsonSerializer(Type type, string? rootName);
public DataContractJsonSerializer(Type type, string rootName);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed.")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")>]
new System.Runtime.Serialization.Json.DataContractJsonSerializer : Type * string -> System.Runtime.Serialization.Json.DataContractJsonSerializer
new System.Runtime.Serialization.Json.DataContractJsonSerializer : Type * string -> System.Runtime.Serialization.Json.DataContractJsonSerializer
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")>]
new System.Runtime.Serialization.Json.DataContractJsonSerializer : Type * string -> System.Runtime.Serialization.Json.DataContractJsonSerializer
Public Sub New (type As Type, rootName As String)
Parameters
- type
- Type
The type of the instances that is serialized or deserialized.
- rootName
- String
The name of the XML element that encloses the content to serialize or deserialize.
- Attributes
Applies to
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);
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")]
public DataContractJsonSerializer(Type type, System.Xml.XmlDictionaryString? rootName);
public DataContractJsonSerializer(Type type, System.Xml.XmlDictionaryString? rootName);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")]
public DataContractJsonSerializer(Type type, System.Xml.XmlDictionaryString? rootName);
public DataContractJsonSerializer(Type type, System.Xml.XmlDictionaryString rootName);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed.")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")>]
new System.Runtime.Serialization.Json.DataContractJsonSerializer : Type * System.Xml.XmlDictionaryString -> System.Runtime.Serialization.Json.DataContractJsonSerializer
new System.Runtime.Serialization.Json.DataContractJsonSerializer : Type * System.Xml.XmlDictionaryString -> System.Runtime.Serialization.Json.DataContractJsonSerializer
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")>]
new System.Runtime.Serialization.Json.DataContractJsonSerializer : Type * System.Xml.XmlDictionaryString -> System.Runtime.Serialization.Json.DataContractJsonSerializer
Public Sub New (type As Type, rootName As XmlDictionaryString)
Parameters
- type
- Type
The type of the instances that is serialized or deserialized.
- rootName
- XmlDictionaryString
An XmlDictionaryString that contains the root element name of the content.
- Attributes
Applies to
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);
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")]
public DataContractJsonSerializer(Type type, string? rootName, System.Collections.Generic.IEnumerable<Type>? knownTypes);
public DataContractJsonSerializer(Type type, string? rootName, System.Collections.Generic.IEnumerable<Type>? knownTypes);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")]
public DataContractJsonSerializer(Type type, string? rootName, System.Collections.Generic.IEnumerable<Type>? knownTypes);
public DataContractJsonSerializer(Type type, string rootName, System.Collections.Generic.IEnumerable<Type> knownTypes);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed.")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")>]
new System.Runtime.Serialization.Json.DataContractJsonSerializer : Type * string * seq<Type> -> System.Runtime.Serialization.Json.DataContractJsonSerializer
new System.Runtime.Serialization.Json.DataContractJsonSerializer : Type * string * seq<Type> -> System.Runtime.Serialization.Json.DataContractJsonSerializer
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")>]
new System.Runtime.Serialization.Json.DataContractJsonSerializer : Type * string * seq<Type> -> System.Runtime.Serialization.Json.DataContractJsonSerializer
Public Sub New (type As Type, rootName As String, knownTypes As IEnumerable(Of Type))
Parameters
- type
- Type
The type of the instances that is serialized or deserialized.
- rootName
- 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.
- Attributes
Applies to
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);
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")]
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);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")]
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);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed.")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")>]
new System.Runtime.Serialization.Json.DataContractJsonSerializer : Type * System.Xml.XmlDictionaryString * seq<Type> -> System.Runtime.Serialization.Json.DataContractJsonSerializer
new System.Runtime.Serialization.Json.DataContractJsonSerializer : Type * System.Xml.XmlDictionaryString * seq<Type> -> System.Runtime.Serialization.Json.DataContractJsonSerializer
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")>]
new System.Runtime.Serialization.Json.DataContractJsonSerializer : Type * System.Xml.XmlDictionaryString * seq<Type> -> System.Runtime.Serialization.Json.DataContractJsonSerializer
Public Sub New (type As Type, rootName As XmlDictionaryString, knownTypes As IEnumerable(Of Type))
Parameters
- type
- Type
The type of the instances that is serialized or deserialized.
- rootName
- 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.
- Attributes