Open
Description
This concept has been discussed for years on the web and I just discovered that C# 7.3 now supports it:
public static Dictionary<int, string> EnumNamedValues<T>() where T : System.Enum
{
var result = new Dictionary<int, string>();
var values = Enum.GetValues(typeof(T));
foreach (int item in values)
result.Add(item, Enum.GetName(typeof(T), item));
return result;
}
@AnthonyDGreen would you happen to know what the discussion was for supporting this in VB as well when it was planned for C#?