JsonStringEnumConverter 建構函式
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
| 名稱 | Description |
|---|---|
| JsonStringEnumConverter() |
初始化類別的實例 JsonStringEnumConverter ,使用預設的命名策略,允許整數值。 |
| JsonStringEnumConverter(JsonNamingPolicy, Boolean) |
初始化類別的實例 JsonStringEnumConverter ,並以指定的命名策略及指示是否允許未定義列舉值的值。 |
JsonStringEnumConverter()
初始化類別的實例 JsonStringEnumConverter ,使用預設的命名策略,允許整數值。
public:
JsonStringEnumConverter();
public JsonStringEnumConverter();
Public Sub New ()
適用於
JsonStringEnumConverter(JsonNamingPolicy, Boolean)
初始化類別的實例 JsonStringEnumConverter ,並以指定的命名策略及指示是否允許未定義列舉值的值。
public JsonStringEnumConverter(System.Text.Json.JsonNamingPolicy? namingPolicy = default, bool allowIntegerValues = true);
public JsonStringEnumConverter(System.Text.Json.JsonNamingPolicy namingPolicy = default, bool allowIntegerValues = true);
new System.Text.Json.Serialization.JsonStringEnumConverter : System.Text.Json.JsonNamingPolicy * bool -> System.Text.Json.Serialization.JsonStringEnumConverter
Public Sub New (Optional namingPolicy As JsonNamingPolicy = Nothing, Optional allowIntegerValues As Boolean = true)
參數
- namingPolicy
- JsonNamingPolicy
撰寫列舉值的可選命名政策。
- allowIntegerValues
- Boolean
true允許未定義的枚舉值;否則,。 false 當 true時,若未定義枚舉值,則輸出為數字而非字串。