EnumerableExt.ForEach(TIn) Method
Applies an Action on all elements in a collection.
Namespace: UltimateXR.Extensions.System.Collections
Assembly: UltimateXR (in UltimateXR.dll) Version: 0.0.0.0
Syntax
C#
public static void ForEach<TIn>(
this IEnumerable<TIn> list,
Action<TIn> action
)
Parameters
- list
- Type: System.Collections.Generic.IEnumerable(TIn)
Elements to apply the action on - action
- Type: System.Action(TIn)
Action to apply
Type Parameters
- TIn
- Element type
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerable(TIn). When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions
Exception | Condition |
---|---|
ArgumentException | Any of the parameters was null |
See Also
Reference
EnumerableExt Class
UltimateXR.Extensions.System.Collections Namespace