| LinqHelperDoT Method (IEnumerableT, ActionT, Int32) |
Performs the given action on each element (incorporating its index) in a sequence when it is
enumerated.
Namespace: DigitalRune.LinqAssembly: DigitalRune (in DigitalRune.dll) Version: 1.20.0.0 (1.20.1.14552)
Syntax public static IEnumerable<T> Do<T>(
this IEnumerable<T> source,
Action<T, int> action
)
<ExtensionAttribute>
Public Shared Function Do(Of T) (
source As IEnumerable(Of T),
action As Action(Of T, Integer)
) As IEnumerable(Of T)
public:
[ExtensionAttribute]
generic<typename T>
static IEnumerable<T>^ Do(
IEnumerable<T>^ source,
Action<T, int>^ action
)
[<ExtensionAttribute>]
static member Do :
source : IEnumerable<'T> *
action : Action<'T, int> -> IEnumerable<'T>
Parameters
- source
- Type: System.Collections.GenericIEnumerableT
A sequence that contains the elements on which to perform action.
- action
- Type: SystemActionT, Int32
The action to execute on each element; the second parameter of the function represents the
index of the element.
Type Parameters
- T
- The type of elements.
Return Value
Type:
IEnumerableTThe sequence of elements.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IEnumerableT. 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 Remarks See Also