using System;
namespace ForeachStuff
{
public class Program
public static void Main(string[] args)
var omg = new Something();
foreach (var o in omg)
Console.WriteLine(o);
}
public class Something
public Something GetEnumerator()
return this;
int i = 0;
public bool MoveNext()
return i++ < 10;
public string Current => "Hello World";