JsonNumberEnumConverter<TEnum> Class

Definition

Converter to convert enums to and from numeric values.

public sealed class JsonNumberEnumConverter<TEnum> : System.Text.Json.Serialization.JsonConverterFactory where TEnum : struct

Type Parameters

TEnum

The enum type that this converter targets.

Inheritance
JsonNumberEnumConverter<TEnum>

Remarks

This is the default converter for enums and can be used to override UseStringEnumConverter on individual types or properties.

Constructors

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

Product Versions
.NET 8 (package-provided), 8, 9 (package-provided), 9
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)