extension method
public static class EnumSelectList
{
public static IEnumerable GetList(this T thing)
where T : IEnumerable
{
var result =
from i in thing
select new SelectListItem
{
Text = i.Value
};
return result;
}
}
new method on the type
public static IEnumerable GetAll()
{
var list = (
from i in _instances
select i.Value)
.Cast();
return list;
}
standard interface
public interface ITypeSafeEnum
{
string Value { get; }
}