using System; using System.Collections.Generic; public static class EnumerableExtensions { /// /// Performs an action on each element in the sequence. /// /// The type of elements in the sequence. /// The sequence to iterate over. /// The action to perform on each element. public static void ForEach(this IEnumerable sequence, Action action) { foreach (var item in sequence) { action(item); } } }