using System.Collections.Generic;
const string Hello = "Hello World";
public List<string> SomeList { get; set; }
public static void Main()
DoSomething("Hello World", x => Console.WriteLine(x));
DoSomething2(x => Console.WriteLine(x));
var list = new List<string>
var myCollection = new MyCollection(list);
myCollection.DoSomething(x => Console.WriteLine(x));
private static void DoSomething(string param,Action<string> doSomething)
private static void DoSomething2(Action<string> doSomething)
public class MyCollection
private List<string> MyList { get; set;}
public MyCollection(List<string> list)
public void DoSomething(Action<string> doSomething)
foreach(string elem in MyList)