แก้ไข

แชร์ผ่าน


JsonStringEnumConverter Class

Definition

Converts enumeration values to and from strings.

public ref class JsonStringEnumConverter sealed : System::Text::Json::Serialization::JsonConverterFactory
public ref class JsonStringEnumConverter : System::Text::Json::Serialization::JsonConverterFactory
public sealed class JsonStringEnumConverter : System.Text.Json.Serialization.JsonConverterFactory
public class JsonStringEnumConverter : System.Text.Json.Serialization.JsonConverterFactory
type JsonStringEnumConverter = class
    inherit JsonConverterFactory
Public NotInheritable Class JsonStringEnumConverter
Inherits JsonConverterFactory
Public Class JsonStringEnumConverter
Inherits JsonConverterFactory
Inheritance
JsonStringEnumConverter

Remarks

Reading is case insensitive. Writing can be customized by using a JsonNamingPolicy.

For more information, see How to customize property names and values with System.Text.Json.

Constructors

JsonStringEnumConverter()

Initializes an instance of the JsonStringEnumConverter class with the default naming policy that allows integer values.

JsonStringEnumConverter(JsonNamingPolicy, Boolean)

Initializes an instance of the JsonStringEnumConverter class with a specified naming policy and a value that indicates whether undefined enumeration values are allowed.

Properties

Type

Gets the type being converted by the current converter instance.

(Inherited from JsonConverterFactory)

Methods

CanConvert(Type)

Determines whether the specified type can be converted to an enum.

CreateConverter(Type, JsonSerializerOptions)

Creates a converter for the specified type.

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to