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.

public:
 System::Object ^ ReadObject(System::IO::Stream ^ stream);
public:
 override System::Object ^ ReadObject(System::IO::Stream ^ stream);
public object ReadObject (System.IO.Stream stream);
public override object? ReadObject (System.IO.Stream stream);
public override object ReadObject (System.IO.Stream stream);
member this.ReadObject : System.IO.Stream -> obj
override this.ReadObject : System.IO.Stream -> obj
Public Function ReadObject (stream As Stream) As Object
Public Overrides Function ReadObject (stream As Stream) As Object

Parameters

stream
Stream

The Stream to be read.

Returns

The deserialized object.

Applies to

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.

public:
 override System::Object ^ ReadObject(System::Xml::XmlDictionaryReader ^ reader);
public override object? ReadObject (System.Xml.XmlDictionaryReader reader);
public override object ReadObject (System.Xml.XmlDictionaryReader reader);
override this.ReadObject : System.Xml.XmlDictionaryReader -> obj
Public Overrides Function ReadObject (reader As XmlDictionaryReader) As Object

Parameters

reader
XmlDictionaryReader

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

Returns

The deserialized object.

Applies to

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.

public:
 override System::Object ^ ReadObject(System::Xml::XmlReader ^ reader);
public override object? ReadObject (System.Xml.XmlReader reader);
public override object ReadObject (System.Xml.XmlReader reader);
override this.ReadObject : System.Xml.XmlReader -> obj
Public Overrides Function ReadObject (reader As XmlReader) As Object

Parameters

reader
XmlReader

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

Returns

The deserialized object.

Applies to

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.

public:
 override System::Object ^ ReadObject(System::Xml::XmlDictionaryReader ^ reader, bool verifyObjectName);
public override object? ReadObject (System.Xml.XmlDictionaryReader reader, bool verifyObjectName);
public override object ReadObject (System.Xml.XmlDictionaryReader reader, bool verifyObjectName);
override this.ReadObject : System.Xml.XmlDictionaryReader * bool -> obj
Public Overrides Function ReadObject (reader As XmlDictionaryReader, verifyObjectName As Boolean) As Object

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

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.

public:
 override System::Object ^ ReadObject(System::Xml::XmlReader ^ reader, bool verifyObjectName);
public override object? ReadObject (System.Xml.XmlReader reader, bool verifyObjectName);
public override object ReadObject (System.Xml.XmlReader reader, bool verifyObjectName);
override this.ReadObject : System.Xml.XmlReader * bool -> obj
Public Overrides Function ReadObject (reader As XmlReader, verifyObjectName As Boolean) As Object

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