Class SystemStringEnumConverter<T>
OptimaJet.Workflow.Core.Designer.SystemStringEnumConverter<T>
Converts JSON strings to and from enumeration values of type T. Deserialization parses enumeration names without regard to case, while serialization uses Enum.ToString().
Namespace: OptimaJet.Workflow.Core.Designer
public class SystemStringEnumConverter<T> : JsonConverter<T> where T : struct, EnumType Hierarchy
- JsonConverter
- JsonConverter<T>
- SystemStringEnumConverter<T> Current type
- JsonConverter<T>
Methods
public override T Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) #Reads a JSON string and parses it as an enumeration value of type
T without regard to case.Parameters
Name
Type
Description
Returns
Type
Description
{T}The enumeration value parsed from the JSON string.
Exceptions
Type
Description
JsonExceptionThe current token is not JsonTokenType.String, or its value cannot be parsed as
T.public override void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options) #Writes an enumeration value as a JSON string containing the result of Enum.ToString().
Parameters
Name
Type
Description
value{T}The enumeration value to write.