GenerateSerializerAttribute 類別

定義

套用至類型時,指定類型是要串行化,而且應該為類型產生串行化程序代碼。

[System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Enum | System.AttributeTargets.Struct)]
public sealed class GenerateSerializerAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Class | System.AttributeTargets.Enum | System.AttributeTargets.Struct)>]
type GenerateSerializerAttribute = class
    inherit Attribute
Public NotInheritable Class GenerateSerializerAttribute
Inherits Attribute
繼承
GenerateSerializerAttribute
屬性

建構函式

GenerateSerializerAttribute()

套用至類型時,指定類型是要串行化,而且應該為類型產生串行化程序代碼。

屬性

GenerateFieldIds

取得或設定何時應該自動指派欄位標識碼。 默認行為是不要自動指派欄位標識碼。

IncludePrimaryConstructorParameters

取得或設定主要建構函式參數是否應該自動包含為可串行化欄位。 預設為 truerecord 類型, false 否則為 。

適用於

另請參閱