JsonSerializableAttribute 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
指示 System.Text.Json 原始碼產生器產生原始碼,以協助優化在序列化與反序列化指定類型及物件圖中型別的實例時的效能。
public ref class JsonSerializableAttribute sealed : System::Text::Json::Serialization::JsonAttribute
[System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=true)]
public sealed class JsonSerializableAttribute : System.Text.Json.Serialization.JsonAttribute
[<System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=true)>]
type JsonSerializableAttribute = class
inherit JsonAttribute
Public NotInheritable Class JsonSerializableAttribute
Inherits JsonAttribute
- 繼承
- 屬性
建構函式
| 名稱 | Description |
|---|---|
| JsonSerializableAttribute(Type) |
初始化一個以指定型別的新 JsonSerializableAttribute 實例。 |
屬性
| 名稱 | Description |
|---|---|
| GenerationMode |
取得或設定模式,指示來源產生器應為該型別產生什麼。 若值為 Default,則將使用指定的 GenerationMode 設定。 |
| TypeId |
在衍生類別中實作時,取得這個 Attribute的唯一標識碼。 (繼承來源 Attribute) |
| TypeInfoPropertyName |
取得或設定產生的型別JsonSerializerContext屬性名稱JsonTypeInfo<T>。 |
方法
| 名稱 | Description |
|---|---|
| Equals(Object) |
傳回值,這個值表示這個實例是否等於指定的物件。 (繼承來源 Attribute) |
| GetHashCode() |
傳回這個實例的哈希碼。 (繼承來源 Attribute) |
| GetType() |
取得目前實例的 Type。 (繼承來源 Object) |
| IsDefaultAttribute() |
在衍生類別中覆寫時,指出這個實例的值是否為衍生類別的預設值。 (繼承來源 Attribute) |
| Match(Object) |
在衍生類別中覆寫時,傳回值,指出這個實例是否等於指定的物件。 (繼承來源 Attribute) |
| MemberwiseClone() |
建立目前 Object的淺層複本。 (繼承來源 Object) |
| ToString() |
傳回表示目前 物件的字串。 (繼承來源 Object) |