DataContractJsonSerializer.WriteObjectContent Method
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.
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)
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)
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
- 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.