loop over an enum c# code example Example: traversing an enum c# var values = Enum.GetValues(typeof(Foos)).Cast<Foos>();