August 21, 2008 01:24 by
admin
Glenn Block has an implementation of ForEach for IEnumerable:
1: public static class IEnumerableUtils {
2: public static void ForEach<T>(this IEnumerable<T> collection, Action<T> action) {
3: foreach(T item in collection) {
4: action(item);
5: }
6: }
Be the first to rate this post
- Currently 0/5 Stars.
- 1
- 2
- 3
- 4
- 5