DataContractJsonSerializer.ReadObject Method

Definition

Deserializes JSON (JavaScript Object Notation) data and returns the deserialized object.

Overloads

ReadObject(Stream)

Reads a document stream in the JSON (JavaScript Object Notation) format and returns the deserialized object.

ReadObject(XmlDictionaryReader)

Reads the XML document mapped from JSON (JavaScript Object Notation) with an XmlDictionaryReader and returns the deserialized object.

ReadObject(XmlReader)

Reads the XML document mapped from JSON (JavaScript Object Notation) with an XmlReader and returns the deserialized object.

ReadObject(XmlDictionaryReader, Boolean)

Reads the XML document mapped from JSON with an XmlDictionaryReader and returns the deserialized object; it also enables you to specify whether the serializer should verify that it is positioned on an appropriate element before attempting to deserialize.

ReadObject(XmlReader, Boolean)

Reads an XML document mapped from JSON with an XmlReader and returns the deserialized object; it also enables you to specify whether the serializer should verify that it is positioned on an appropriate element before attempting to deserialize.

ReadObject(Stream)

Source:
DataContractJsonSerializer.cs
Source:
DataContractJsonSerializer.cs
Source:
DataContractJsonSerializer.cs

Reads a document stream in the JSON (JavaScript Object Notation) format and returns the deserialized object.

C#
public object ReadObject(System.IO.Stream stream);
C#
public override object? ReadObject(System.IO.Stream stream);
C#
public override object ReadObject(System.IO.Stream stream);

Parameters

stream
Stream

The Stream to be read.

Returns

The deserialized object.

Applies to

.NET 10 i druge verzije
Proizvod Verzije
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1
UWP 10.0

ReadObject(XmlDictionaryReader)

Source:
DataContractJsonSerializer.cs
Source:
DataContractJsonSerializer.cs
Source:
DataContractJsonSerializer.cs

Reads the XML document mapped from JSON (JavaScript Object Notation) with an XmlDictionaryReader and returns the deserialized object.

C#
public override object? ReadObject(System.Xml.XmlDictionaryReader reader);
C#
public override object ReadObject(System.Xml.XmlDictionaryReader reader);

Parameters

reader
XmlDictionaryReader

An XmlDictionaryReader used to read the XML document mapped from JSON.

Returns

The deserialized object.

Applies to

.NET 10 i druge verzije
Proizvod Verzije
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

ReadObject(XmlReader)

Source:
DataContractJsonSerializer.cs
Source:
DataContractJsonSerializer.cs
Source:
DataContractJsonSerializer.cs

Reads the XML document mapped from JSON (JavaScript Object Notation) with an XmlReader and returns the deserialized object.

C#
public override object? ReadObject(System.Xml.XmlReader reader);
C#
public override object ReadObject(System.Xml.XmlReader reader);

Parameters

reader
XmlReader

An XmlReader used to read the XML document mapped from JSON.

Returns

The deserialized object.

Applies to

.NET 10 i druge verzije
Proizvod Verzije
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

ReadObject(XmlDictionaryReader, Boolean)

Source:
DataContractJsonSerializer.cs
Source:
DataContractJsonSerializer.cs
Source:
DataContractJsonSerializer.cs

Reads the XML document mapped from JSON with an XmlDictionaryReader and returns the deserialized object; it also enables you to specify whether the serializer should verify that it is positioned on an appropriate element before attempting to deserialize.

C#
public override object? ReadObject(System.Xml.XmlDictionaryReader reader, bool verifyObjectName);
C#
public override object ReadObject(System.Xml.XmlDictionaryReader reader, bool verifyObjectName);

Parameters

reader
XmlDictionaryReader

An XmlDictionaryReader used to read the XML document mapped from JSON.

verifyObjectName
Boolean

true to check whether the enclosing XML element name and namespace correspond to the expected name and namespace; otherwise, false to skip the verification. The default is true.

Returns

The deserialized object.

Applies to

.NET 10 i druge verzije
Proizvod Verzije
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1

ReadObject(XmlReader, Boolean)

Source:
DataContractJsonSerializer.cs
Source:
DataContractJsonSerializer.cs
Source:
DataContractJsonSerializer.cs

Reads an XML document mapped from JSON with an XmlReader and returns the deserialized object; it also enables you to specify whether the serializer should verify that it is positioned on an appropriate element before attempting to deserialize.

C#
public override object? ReadObject(System.Xml.XmlReader reader, bool verifyObjectName);
C#
public override object ReadObject(System.Xml.XmlReader reader, bool verifyObjectName);

Parameters

reader
XmlReader

An XmlReader used to read the XML document mapped from JSON.

verifyObjectName
Boolean

true to check whether the enclosing XML element name and namespace correspond to the expected name and namespace; otherwise, false, which skips the verification. The default is true.

Returns

The deserialized object.

Applies to

.NET 10 i druge verzije
Proizvod Verzije
.NET Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1