แก้ไข

แชร์ผ่าน


JsonStringEnumConverter<TEnum> Class

Definition

Converter to convert enums to and from strings.

generic <typename TEnum>
 where TEnum : value classpublic ref class JsonStringEnumConverter : System::Text::Json::Serialization::JsonConverterFactory
public class JsonStringEnumConverter<TEnum> : System.Text.Json.Serialization.JsonConverterFactory where TEnum : struct
type JsonStringEnumConverter<'Enum (requires 'Enum : struct)> = class
    inherit JsonConverterFactory
Public Class JsonStringEnumConverter(Of TEnum)
Inherits JsonConverterFactory

Type Parameters

TEnum

The enum type that this converter targets.

Inheritance
JsonStringEnumConverter<TEnum>

Remarks

Reading is case insensitive, and writing can be customized via a JsonNamingPolicy.

Constructors

JsonStringEnumConverter<TEnum>()

Initializes a new instance of JsonStringEnumConverter<TEnum> with the default naming policy and that allows integer values.

JsonStringEnumConverter<TEnum>(JsonNamingPolicy, Boolean)

Initializes a new instance of JsonStringEnumConverter<TEnum>.

Properties

Type

Gets the type being converted by the current converter instance.

(Inherited from JsonConverterFactory)

Methods

CanConvert(Type)

When overridden in a derived class, determines whether the converter instance can convert the specified object type.

CreateConverter(Type, JsonSerializerOptions)

Creates a converter for a 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