How can you enumerate an enum in C#?
enum
E.g. the following code does not compile:
public enum Suit {
Also you can bind to the public static members of the enum directly by using reflection:
typeof(Suit).GetMembers(BindingFlags.Public | BindingFlags.Static) .ToList().ForEach(x => DoSomething(x.Name));