Share via


JsonConverter<T>.WriteAsPropertyName 方法

定義

將字典索引鍵寫入為 JSON 屬性名稱。

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

參數

writer
Utf8JsonWriter

要寫入的目標 Utf8JsonWriter

value
T

要進行轉換的值。 的值 HandleNull 會判斷轉換器是否處理 null 值。

options
JsonSerializerOptions

寫入值時要使用的選項。

備註

這個方法應該在序列化字典索引鍵中使用的型別自訂轉換器中覆寫。

適用於