using System; using System.Collections.Generic; using System.Text; namespace Sarand.Net.Standard.Base.Utils { //======================================================================= public static class EnumerableUtil { //------------------------------------------------------------------- // F o r E a c h //------------------------------------------------------------------- public static void ForEach (this IEnumerable source, Action action) { foreach (var item in source) action(item); } public static void ForEachOrBreak (this IEnumerable source, Func func) { foreach (var item in source) { bool result = func(item); if (result) break; } } //------------------------------------------------------------------- } //======================================================================= }