Class JsonStringEnumMemberConverter
- Namespace
- Cloudflare.NET.Core.Json
- Assembly
- Cloudflare.NET.dll
A JsonConverterFactory that creates a converter to properly handle enums decorated with EnumMemberAttribute. This allows for serialization and deserialization based on the attribute's value rather than the enum member's name.
public class JsonStringEnumMemberConverter : JsonConverterFactory
- Inheritance
-
JsonStringEnumMemberConverter
- Inherited Members
Methods
CanConvert(Type)
When overridden in a derived class, determines whether the converter instance can convert the specified object type.
public override bool CanConvert(Type typeToConvert)
Parameters
typeToConvertTypeThe type of the object to check whether it can be converted by this converter instance.
Returns
CreateConverter(Type, JsonSerializerOptions)
Creates a converter for a specified type.
public override JsonConverter CreateConverter(Type typeToConvert, JsonSerializerOptions options)
Parameters
typeToConvertTypeThe type handled by the converter.
optionsJsonSerializerOptionsThe serialization options to use.
Returns
- JsonConverter
A converter for which
Tis compatible withtypeToConvert.