Created
October 1, 2012 10:25
-
-
Save AlexanderBrevigSublime/3810761 to your computer and use it in GitHub Desktop.
C#: LINQ ForEach
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace System.Linq | |
{ | |
public static class IEnumerableExtensionForEach | |
{ | |
public static void ForEach<T>(this IEnumerable<T> list, Action<T> block) { | |
foreach (var item in list) { | |
block(item); | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment