Enumerate All the Values in an Enum

See an easy way to enumerate all the values.

public enum WorkTypes{Remote = 0,Office = 1,Exempted = 2}foreach (WorkTypes workType in Enum.GetValues(typeof(WorkTypes)))Console.WriteLine(workType);
Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Related Posts