JsonStringEnumConverter 构造函数
定义
重载
JsonStringEnumConverter() |
使用允许整数值的默认命名策略初始化 JsonStringEnumConverter 类的实例。Initializes an instance of the JsonStringEnumConverter class with the default naming policy that allows integer values. |
JsonStringEnumConverter(JsonNamingPolicy, Boolean) |
使用指定命名策略以及指示是否允许未定义枚举值的值初始化 JsonStringEnumConverter 类的实例。Initializes an instance of the JsonStringEnumConverter class with a specified naming policy and a value that indicates whether undefined enumeration values are allowed. |
JsonStringEnumConverter()
使用允许整数值的默认命名策略初始化 JsonStringEnumConverter 类的实例。Initializes an instance of the JsonStringEnumConverter class with the default naming policy that allows integer values.
public:
JsonStringEnumConverter();
public JsonStringEnumConverter ();
Public Sub New ()
适用于
JsonStringEnumConverter(JsonNamingPolicy, Boolean)
使用指定命名策略以及指示是否允许未定义枚举值的值初始化 JsonStringEnumConverter 类的实例。Initializes an instance of the JsonStringEnumConverter class with a specified naming policy and a value that indicates whether undefined enumeration values are allowed.
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
用于写入枚举值的可选命名策略。The optional naming policy for writing enum values.
- allowIntegerValues
- Boolean
true
表示允许未定义的枚举值;否则为 false
。true
to allow undefined enum values; otherwise, false
. 为 true
时,如果未定义枚举值,则它将输出为数字而不是字符串。When true
, if an enum value isn't defined, it will output as a number rather than a string.