Click or drag to resize
DigitalRuneLinqHelperDoT Method (IEnumerableT, ActionT)
Performs the given action on each element in a sequence when it is enumerated.

Namespace: DigitalRune.Linq
Assembly: 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> action
)

Parameters

source
Type: System.Collections.GenericIEnumerableT
A sequence that contains the elements on which to perform action.
action
Type: SystemActionT
The action to execute on each element.

Type Parameters

T
The type of elements.

Return Value

Type: IEnumerableT
The 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
ExceptionCondition
ArgumentNullExceptionsource or action is .
Remarks
DoT(IEnumerableT, ActionT) is similar to ForEachT(IEnumerableT, ActionT). The difference is that ForEachT(IEnumerableT, ActionT) immediately enumerates the given sequence. DoT(IEnumerableT, ActionT) does not automatically trigger the enumeration. Instead it returns the IEnumerableT.
See Also