Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexanderBrevigSublime/3810761 to your computer and use it in GitHub Desktop.
Save AlexanderBrevigSublime/3810761 to your computer and use it in GitHub Desktop.
C#: LINQ ForEach
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