Show / Hide Table of Contents

Class EnumConverterUtil.JsonEnumConverter<T>

Custom JSON converter for serializing and deserializing enums.

Inheritance
object
JsonConverter
JsonConverter<T>
EnumConverterUtil.JsonEnumConverter<T>
Inherited Members
JsonConverter<T>.CanConvert(Type)
JsonConverter<T>.ReadAsPropertyName(ref Utf8JsonReader, Type, JsonSerializerOptions)
JsonConverter<T>.WriteAsPropertyName(Utf8JsonWriter, T, JsonSerializerOptions)
JsonConverter<T>.HandleNull
JsonConverter<T>.Type
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: EasySave_Project.Util
Assembly: .dll
Syntax
public class EnumConverterUtil.JsonEnumConverter<T> : JsonConverter<T> where T : struct, Enum
Type Parameters
Name Description
T

Methods

| Edit this page View Source

Read(ref Utf8JsonReader, Type, JsonSerializerOptions)

Reads and converts a JSON string to an enum value.

Declaration
public override T Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
Parameters
Type Name Description
Utf8JsonReader reader
Type typeToConvert
JsonSerializerOptions options
Returns
Type Description
T
Overrides
JsonConverter<T>.Read(ref Utf8JsonReader, Type, JsonSerializerOptions)
| Edit this page View Source

Write(Utf8JsonWriter, T, JsonSerializerOptions)

Writes an enum value as a JSON string in uppercase.

Declaration
public override void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options)
Parameters
Type Name Description
Utf8JsonWriter writer
T value
JsonSerializerOptions options
Overrides
JsonConverter<T>.Write(Utf8JsonWriter, T, JsonSerializerOptions)
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX