c# iterate through enums code example Example: loop over all values in enum var values = Enum.GetValues(typeof(Foos)).Cast<Foos>();