/// <summary>
 /// Gets the EnumMemberAttribute's value from the enum's value.
 /// </summary>
 /// <typeparam name="TEnum">The type of enum.</typeparam>
 /// <param name="value">The enum's value.</param>
 /// <returns>string.</returns>
 public static string ToEnumMemberValue <TEnum>(this TEnum value) where TEnum : struct, Enum
 {
     return(EnumNameMapper <TEnum> .GetName(value));
 }
Ejemplo n.º 2
0
 public override void Write(Utf8JsonWriter writer, T value, JsonSerializerOptions options)
 {
     writer.WriteStringValue(EnumNameMapper <T> .GetName(value));
 }