Share via


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 序列化的自訂轉換器

適用於