Is there a way to make the default Enum.ToString()
to convert to snake_case instead of PascalCase? And that change to be global, so I don't have to do that all over again.
public enum SpellTypes
{
HorizonFocus
}
public sealed class Settings
{
public Settings(SpellTypes types)
{
TypeString = types.ToString(); // actual: HorizonFocus, expected: horizon_focus
}
public string TypeString { get; }
}
In addition
I tried the following with Macross.Json.Extensions
but it didn't apply the changes to the TypeString.
[JsonConverter(typeof(JsonStringEnumMemberConverter))]
public enum SpellTypes
{
[EnumMember(Value = "horizon_focus")]
HorizonFocus
}