Skip to content

Instantly share code, notes, and snippets.

@beccasaurus
Created February 6, 2011 05:56
Show Gist options
  • Save beccasaurus/813173 to your computer and use it in GitHub Desktop.
Save beccasaurus/813173 to your computer and use it in GitHub Desktop.
var eatFood = new Action<object>(food => Console.WriteLine("I eat {0}", food));
var foods = new List<string> { "banana", "bagel", "pizza" };
foods.ForEach(food => eatFood.Invoke(food));
// I eat banana
// I eat bagel
// I eat pizza
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment