IEnumerable trick saving a ToList()

public static class IEnumerableExtensions
{
public static void ForEach( this IEnumerable list , Action action)
{
foreach (T item in list)
{
action(item);
}
}
}

Thank you Douglas Marsh!

Share on Facebook

Leave a Reply

Your email address will not be published. Required fields are marked *