Performs the specified action on each element of the List.
- action
- The action delegate to perform on each element of the List.
Type Reason ArgumentNullException action is null.
The action is a delegate that performs an action on the object passed to it. The elements of the current List are individually passed to the action delegate, sequentially, in index order, and on the same thread as that used to call ForEach. Execution stops if the action throws an exception.
Namespace: System.Collections.Generic
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0