Because ForEach(Action) existed before IEnumerable<T>
existed.
Since it was not added with the other extension methods, one can assume that the C# designers felt it was a bad design and prefer the foreach
construct.
Edit:
If you want you can create your own extension method, it won't override the one for a List<T>
but it will work for any other class which implements IEnumerable<T>
.
public static class IEnumerableExtensions
{
public static void ForEach<T>(this IEnumerable<T> source, Action<T> action)
{
foreach (T item in source)
action(item);
}
}