Performs the given Action parallel for each element in the enumerable.

Namespace: UnityThreading
Assembly: UnityThreading (in UnityThreading.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

C#
public static IEnumerable<Task> ParallelForEach<T>(
	this IEnumerable<T> that,
	Action<T> action
)
Visual Basic
<ExtensionAttribute> _
Public Shared Function ParallelForEach(Of T) ( _
	that As IEnumerable(Of T), _
	action As Action(Of T) _
) As IEnumerable(Of Task)
Visual C++
[ExtensionAttribute]
public:
generic<typename T>
static IEnumerable<Task^>^ ParallelForEach(
	IEnumerable<T>^ that, 
	Action<T>^ action
)

Parameters

that
Type: System.Collections.Generic..::..IEnumerable<(Of <(<'T>)>)>
action
Type: System..::..Action<(Of <(<'T>)>)>
The action to perform for each element.

Type Parameters

T

Return Value

IEnumerable of created tasks.

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. For more information, see or .

See Also