Executes the given action on each element in the source sequence
and yields it.
Declaration Syntax
C# | Visual Basic | Visual C++ |
public static IEnumerable<T> Pipe<T>( this IEnumerable<T> source, Action<T> action )
<ExtensionAttribute> _ Public Shared Function Pipe(Of T) ( _ source As IEnumerable(Of T), _ action As Action(Of T) _ ) As IEnumerable(Of T)
public: [ExtensionAttribute] generic<typename T> static IEnumerable<T>^ Pipe( IEnumerable<T>^ source, Action<T>^ action )
Generic Template Parameters
- T
- The type of the elements in the sequence
Parameters
- source (IEnumerable<(Of <(<'T>)>)>)
- The sequence of elements
- action (Action<(Of <(<'T>)>)>)
- The action to execute on each element
Return Value
[Missing <returns> documentation for "M:MoreLinq.MoreEnumerable.Pipe``1(System.Collections.Generic.IEnumerable{``0},System.Action{``0})"]
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerable<(Of <(<'T>)>)>. When you use instance method syntax to call this method, omit the first parameter.
Remarks
The returned sequence is essentially a duplicate of
the original, but with the extra action being executed while the
sequence is evaluated. The action is always taken before the element
is yielded, so any changes made by the action will be visible in the
returned sequence. This operator uses deferred execution and streams it results.
Assembly: MoreLinq (Module: MoreLinq.dll) Version: 1.0.16006.0 (1.0.16006.1845)