Is it possible de create a Count and a ToList extension method for an Enum instance ? I have tried this but don't know how to replace the "???", related to the type of the enum "e".
public static class EnumExtensions
{
public static int Count(this Enum e)
{
return Enum.GetNames(typeof(???)).Length;
}
public static List<???> ToList(this Enum e)
{
return Enum.GetValues(typeof(???)).Cast<???>().ToList();
}
}
Thanks a lot !