foreach reference C# code example
Example 1: c# foreach enum
enum Foos {
Foo,
Bar,
}
foreach(Foos val in Enum.GetValues(typeof(Foos))) {}
Example 2: c# foreach
var numbers = new NumberList { 0, 1, 2, 3, 4, 5 };
foreach (int num in numbers)
{
DoSomething();
}