Essential Types C# Book

Enum.GetValues returns an array comprising all members of a particular enum type:
using System;
using System.Numerics;
enum WeekDay
{
Monday, Tuesday, Wednesday, Thursday, Friday
}
class Sample
{
public static void Main()
{
foreach (Enum value in Enum.GetValues(typeof(WeekDay)))
Console.WriteLine(value);
}
}
The output:
Monday
Tuesday
Wednesday
Thursday
Friday