print all enums from a loop code example
Example 1: loop through an enum c#
public enum Days {
Monday,
Tuesday,
Wednesday
}
foreach(Days day in Enum.GetValues(typeof(Days))) {
}
Example 2: loop over all values in enum
var values = Enum.GetValues(typeof(Foos)).Cast<Foos>();