Executes a foreach (For Each in Visual Basic) operation on an IEnumerable in which iterations may run in parallel.

Namespace: Composite.Core.Parallelization
Assembly: Composite (in Composite.dll) Version: 6.1.6325.31818

Syntax

C#
public static void ForEach<TSource>(
	IEnumerable<TSource> source,
	Action<TSource> body
)
Visual Basic
Public Shared Sub ForEach(Of TSource) ( _
	source As IEnumerable(Of TSource), _
	body As Action(Of TSource) _
)
Visual C++
public:
generic<typename TSource>
static void ForEach(
	IEnumerable<TSource>^ source, 
	Action<TSource>^ body
)

Parameters

source
Type: System.Collections.Generic..::..IEnumerable<(Of <(<'TSource>)>)>
An enumerable data source.
body
Type: System..::..Action<(Of <(<'TSource>)>)>
The delegate that is invoked once per iteration.

Type Parameters

TSource
The type of the data in the source.

See Also