Class EnumConverter<T>

Namespace
Cratis.Json
Assembly
Cratis.Fundamentals.dll

Represents an JsonConverter<T> for converting enums.

public class EnumConverter<T> : JsonConverter<T> where T : struct, Enum

Type Parameters

T

Type of enum.

Inheritance
EnumConverter<T>
Inherited Members
Extension Methods

Constructors

EnumConverter()

public EnumConverter()

Methods

Read(ref Utf8JsonReader, Type, JsonSerializerOptions)

public override T Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)

Parameters

reader Utf8JsonReader
typeToConvert Type
options JsonSerializerOptions

Returns

T

Write(Utf8JsonWriter, T, JsonSerializerOptions)

public override void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options)

Parameters

writer Utf8JsonWriter
value T
options JsonSerializerOptions