語言

JsonConverter<T>.Write(Utf8JsonWriter, T, JsonSerializerOptions) 方法

定義

將指定的值寫成 JSON。

public:
 abstract void Write(System::Text::Json::Utf8JsonWriter ^ writer, T value, System::Text::Json::JsonSerializerOptions ^ options);
public abstract void Write(System.Text.Json.Utf8JsonWriter writer, T value, System.Text.Json.JsonSerializerOptions options);
abstract member Write : System.Text.Json.Utf8JsonWriter * 'T * System.Text.Json.JsonSerializerOptions -> unit
Public MustOverride Sub Write (writer As Utf8JsonWriter, value As T, options As JsonSerializerOptions)

參數

writer
Utf8JsonWriter

寫信的對象。

value
T

要轉換為 JSON 的值。

options
JsonSerializerOptions

一個指定序列化選項的物件。

備註

轉換器可以拋出任何例外,但當無法建立 JSON 時,它應該會拋出 JsonException 。

欲了解更多資訊,請參閱 如何撰寫 JSON 序列化的自訂轉換器。

適用於