using System; using System.Collections.Generic; public class Test { public static void Main () { Foo nav = new Foo (); IEnumerable t = TestRoutine (new int [] { 1 }, nav); new List (t); } public static IEnumerable TestRoutine (IEnumerable a, Foo f) { f.CreateItem (); foreach (T n in a) { yield return n; } } } public class Foo { public void CreateItem () { } }