Muokkaa

Jaa


DataContractJsonSerializer.WriteObjectContent Method

Definition

Writes the content of an object to XML that may be mapped to JavaScript Object Notation (JSON) without writing the wrapping element.

Overloads

WriteObjectContent(XmlDictionaryWriter, Object)

Writes the XML content that can be mapped to JavaScript Object Notation (JSON) using an XmlDictionaryWriter.

WriteObjectContent(XmlWriter, Object)

Writes the XML content that can be mapped to JavaScript Object Notation (JSON) using an XmlWriter.

WriteObjectContent(XmlDictionaryWriter, Object)

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

Writes the XML content that can be mapped to JavaScript Object Notation (JSON) using an XmlDictionaryWriter.

public:
 override void WriteObjectContent(System::Xml::XmlDictionaryWriter ^ writer, System::Object ^ graph);
public override void WriteObjectContent (System.Xml.XmlDictionaryWriter writer, object? graph);
public override void WriteObjectContent (System.Xml.XmlDictionaryWriter writer, object graph);
override this.WriteObjectContent : System.Xml.XmlDictionaryWriter * obj -> unit
Public Overrides Sub WriteObjectContent (writer As XmlDictionaryWriter, graph As Object)

Parameters

writer
XmlDictionaryWriter

The XmlDictionaryWriter to write to.

graph
Object

The object to write.

Exceptions

The type being serialized does not conform to data contract rules. For example, the DataContractAttribute attribute has not been applied to the type.

There is a problem with the instance being written.

The maximum number of objects to serialize has been exceeded. Check the MaxItemsInObjectGraph property.

Applies to

WriteObjectContent(XmlWriter, Object)

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

Writes the XML content that can be mapped to JavaScript Object Notation (JSON) using an XmlWriter.

public:
 override void WriteObjectContent(System::Xml::XmlWriter ^ writer, System::Object ^ graph);
public override void WriteObjectContent (System.Xml.XmlWriter writer, object? graph);
public override void WriteObjectContent (System.Xml.XmlWriter writer, object graph);
override this.WriteObjectContent : System.Xml.XmlWriter * obj -> unit
Public Overrides Sub WriteObjectContent (writer As XmlWriter, graph As Object)

Parameters

writer
XmlWriter

The XmlWriter used to write to.

graph
Object

The object to write.

Exceptions

The type being serialized does not conform to data contract rules. For example, the DataContractAttribute attribute has not been applied to the type.

There is a problem with the instance being written.

The maximum number of objects to serialize has been exceeded. Check the MaxItemsInObjectGraph property.

Applies to