JsonConverter<T>.WriteAsPropertyName 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
它會把字典鍵寫成 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
撰寫價值時應採用的選項。
備註
此方法應在序列化字典鍵碼中使用的自訂轉換器中覆寫。