DataContractJsonSerializer.WriteObject Metódus
Definíció
Fontos
Egyes információk olyan, kiadás előtti termékekre vonatkoznak, amelyek a kiadásig még jelentősen módosulhatnak. A Microsoft nem vállal kifejezett vagy törvényi garanciát az itt megjelenő információért.
Szerializál egy objektumot egy JavaScript Object Notation (JSON) dokumentumba.
Túlterhelések
| Name | Description |
|---|---|
| WriteObject(Stream, Object) |
Szerializál egy megadott objektumot a JavaScript Object Notation (JSON) adataihoz, és az eredményként kapott JSON-t egy streambe írja. |
| WriteObject(XmlDictionaryWriter, Object) |
Szerializál egy objektumot XML-fájlba, amely a JavaScript Object Notation (JSON) kifejezésre képezhető le. Az összes objektumadatot megírja, beleértve a kezdő XML-elemet, a tartalmat és a záró elemet egy XmlDictionaryWriter. |
| WriteObject(XmlWriter, Object) |
Szerializál egy objektumot XML-fájlba, amely a JavaScript Object Notation (JSON) kifejezésre képezhető le. Az összes objektumadatot megírja, beleértve a kezdő XML-elemet, a tartalmat és a záró elemet egy XmlWriter. |
WriteObject(Stream, Object)
Szerializál egy megadott objektumot a JavaScript Object Notation (JSON) adataihoz, és az eredményként kapott JSON-t egy streambe írja.
public:
void WriteObject(System::IO::Stream ^ stream, System::Object ^ graph);
public:
override void WriteObject(System::IO::Stream ^ stream, System::Object ^ graph);
public void WriteObject(System.IO.Stream stream, object graph);
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")]
public override void WriteObject(System.IO.Stream stream, object? graph);
public override void WriteObject(System.IO.Stream stream, object? graph);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")]
public override void WriteObject(System.IO.Stream stream, object? graph);
public override void WriteObject(System.IO.Stream stream, object graph);
member this.WriteObject : System.IO.Stream * obj -> unit
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed.")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")>]
override this.WriteObject : System.IO.Stream * obj -> unit
override this.WriteObject : System.IO.Stream * obj -> unit
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")>]
override this.WriteObject : System.IO.Stream * obj -> unit
Public Sub WriteObject (stream As Stream, graph As Object)
Public Overrides Sub WriteObject (stream As Stream, graph As Object)
Paraméterek
- graph
- Object
A streambe írni kívánt adatokat tartalmazó objektum.
- Attribútumok
Kivételek
A szerializált típus nem felel meg az adatszerződés szabályainak. Az attribútum például DataContractAttribute nem lett alkalmazva a típusra.
Probléma van a megírt példánysal.
Túllépte a szerializálandó objektumok maximális számát. Ellenőrizze a MaxItemsInObjectGraph tulajdonságot.
A következőre érvényes:
WriteObject(XmlDictionaryWriter, Object)
Szerializál egy objektumot XML-fájlba, amely a JavaScript Object Notation (JSON) kifejezésre képezhető le. Az összes objektumadatot megírja, beleértve a kezdő XML-elemet, a tartalmat és a záró elemet egy XmlDictionaryWriter.
public:
override void WriteObject(System::Xml::XmlDictionaryWriter ^ writer, System::Object ^ graph);
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")]
public override void WriteObject(System.Xml.XmlDictionaryWriter writer, object? graph);
public override void WriteObject(System.Xml.XmlDictionaryWriter writer, object? graph);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")]
public override void WriteObject(System.Xml.XmlDictionaryWriter writer, object? graph);
public override void WriteObject(System.Xml.XmlDictionaryWriter writer, object graph);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed.")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")>]
override this.WriteObject : System.Xml.XmlDictionaryWriter * obj -> unit
override this.WriteObject : System.Xml.XmlDictionaryWriter * obj -> unit
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")>]
override this.WriteObject : System.Xml.XmlDictionaryWriter * obj -> unit
Public Overrides Sub WriteObject (writer As XmlDictionaryWriter, graph As Object)
Paraméterek
- writer
- XmlDictionaryWriter
Az XmlDictionaryWriter XML-dokumentum vagy stream JSON-megfeleltetéséhez használt.
- graph
- Object
Az írandó adatokat tartalmazó objektum.
- Attribútumok
Kivételek
A szerializált típus nem felel meg az adatszerződés szabályainak. Az attribútum például DataContractAttribute nem lett alkalmazva a típusra.
Probléma van a megírt példánysal.
Túllépte a szerializálandó objektumok maximális számát. Ellenőrizze a MaxItemsInObjectGraph tulajdonságot.
A következőre érvényes:
WriteObject(XmlWriter, Object)
Szerializál egy objektumot XML-fájlba, amely a JavaScript Object Notation (JSON) kifejezésre képezhető le. Az összes objektumadatot megírja, beleértve a kezdő XML-elemet, a tartalmat és a záró elemet egy XmlWriter.
public:
override void WriteObject(System::Xml::XmlWriter ^ writer, System::Object ^ graph);
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")]
public override void WriteObject(System.Xml.XmlWriter writer, object? graph);
public override void WriteObject(System.Xml.XmlWriter writer, object? graph);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")]
public override void WriteObject(System.Xml.XmlWriter writer, object? graph);
public override void WriteObject(System.Xml.XmlWriter writer, object graph);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed.")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")>]
override this.WriteObject : System.Xml.XmlWriter * obj -> unit
override this.WriteObject : System.Xml.XmlWriter * obj -> unit
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("Data Contract Serialization and Deserialization might require types that cannot be statically analyzed. Make sure all of the required types are preserved.")>]
override this.WriteObject : System.Xml.XmlWriter * obj -> unit
Public Overrides Sub WriteObject (writer As XmlWriter, graph As Object)
Paraméterek
- graph
- Object
Az írandó adatokat tartalmazó objektum.
- Attribútumok
Kivételek
A szerializált típus nem felel meg az adatszerződés szabályainak. Az attribútum például DataContractAttribute nem lett alkalmazva a típusra.
Probléma van a megírt példánysal.
Túllépte a szerializálandó objektumok maximális számát. Ellenőrizze a MaxItemsInObjectGraph tulajdonságot.