C# foreach enum state code example Example: c# foreach enum enum Foos { Foo, Bar, } foreach(Foos val in Enum.GetValues(typeof(Foos))) {}