ForEach, a simple but very useful extension method
This evening I was writing some code (Yay!) for an Xml based MEF catalog I am prototyping. I came across the need to invoke a set of methods on an IEnumerable<T> that was returned from a LINQ to XML query. Unfortunately no such animal exists on IEnumerable.
It took me < 5 mins to write this
1: public static class IEnumerableUtils
3: public static void ForEach<T>(this IEnumerable<T> collection, Action<T> action)
5: foreach(T item in collection)