DataContractJsonSerializer.WriteObjectContent Method
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.
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. |
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
.NET 10 and other versions
Product | Versions |
---|---|
.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 |
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.
Applies to
.NET 10 and other versions
Product | Versions |
---|---|
.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 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: