public static void ForEach
{
if (items == null)
return;
if (action == null)
throw new ArgumentNullException("action");
foreach (var item in items)
action(item);
}
This will give you compile time type checking which the foreach keyword would not pick up until runtime.
No comments:
Post a Comment