public static bool TryParse <T>(string?s, out T value) where T : struct, Enum { if (!(s is null) && EnumValues <T> .StringToValue.TryGetValue(s, out value)) { return(true); } return(EnumStringConverter.TryParse(s, out value)); }