DataContractJsonSerializer.WriteObject 메서드

정의

개체를 JSON 문서로 serialize합니다.

오버로드

WriteObject(Stream, Object)

지정된 개체를 JSON(JavaScript Object Notation) 데이터로 serialize하고 결과 JSON을 스트림에 씁니다.

WriteObject(XmlDictionaryWriter, Object)

JSON에 매핑할 수 있는 XML로 개체를 serialize합니다. XmlDictionaryWriter를 사용하여 모든 개체 데이터(XML 요소, 콘텐츠, 닫기 요소)를 씁니다.

WriteObject(XmlWriter, Object)

JSON에 매핑할 수 있는 XML로 개체를 serialize합니다. XmlWriter를 사용하여 모든 개체 데이터(XML 요소, 콘텐츠, 닫기 요소)를 씁니다.

WriteObject(Stream, Object)

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

지정된 개체를 JSON(JavaScript Object Notation) 데이터로 serialize하고 결과 JSON을 스트림에 씁니다.

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);
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
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)

매개 변수

stream
Stream

결과를 쓸 대상 Stream입니다.

graph
Object

스트림에 쓸 데이터를 포함하는 개체입니다.

예외

serialize하고 있는 형식이 데이터 계약 규칙을 따르지 않는 경우. DataContractAttribute 특성이 형식에 적용되지 않은 경우를 예로 들 수 있습니다.

쓰고 있는 인스턴스에 문제가 있는 경우

serialize할 최대 개체 수가 초과된 경우. MaxItemsInObjectGraph 속성을 확인합니다.

적용 대상

WriteObject(XmlDictionaryWriter, Object)

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

JSON에 매핑할 수 있는 XML로 개체를 serialize합니다. XmlDictionaryWriter를 사용하여 모든 개체 데이터(XML 요소, 콘텐츠, 닫기 요소)를 씁니다.

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

매개 변수

writer
XmlDictionaryWriter

JSON에 매핑할 XML 문서 또는 스트림을 쓰는 데 사용되는 XmlDictionaryWriter입니다.

graph
Object

쓸 데이터를 포함하는 개체입니다.

예외

serialize하고 있는 형식이 데이터 계약 규칙을 따르지 않는 경우. DataContractAttribute 특성이 형식에 적용되지 않은 경우를 예로 들 수 있습니다.

쓰고 있는 인스턴스에 문제가 있는 경우

serialize할 최대 개체 수가 초과된 경우. MaxItemsInObjectGraph 속성을 확인합니다.

적용 대상

WriteObject(XmlWriter, Object)

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

JSON에 매핑할 수 있는 XML로 개체를 serialize합니다. XmlWriter를 사용하여 모든 개체 데이터(XML 요소, 콘텐츠, 닫기 요소)를 씁니다.

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

매개 변수

writer
XmlWriter

JSON에 매핑할 XML 문서를 쓰는 데 사용되는 XmlWriter입니다.

graph
Object

쓸 데이터를 포함하는 개체입니다.

예외

serialize하고 있는 형식이 데이터 계약 규칙을 따르지 않는 경우. DataContractAttribute 특성이 형식에 적용되지 않은 경우를 예로 들 수 있습니다.

쓰고 있는 인스턴스에 문제가 있는 경우

serialize할 최대 개체 수가 초과된 경우. MaxItemsInObjectGraph 속성을 확인합니다.

적용 대상