Performs the given Func 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<TResult>> ParallelForEach<TResult, T>(
	this IEnumerable<T> that,
	Func<T, TResult> action
)
Visual Basic
<ExtensionAttribute> _
Public Shared Function ParallelForEach(Of TResult, T) ( _
	that As IEnumerable(Of T), _
	action As Func(Of T, TResult) _
) As IEnumerable(Of Task(Of TResult))
Visual C++
[ExtensionAttribute]
public:
generic<typename TResult, typename T>
static IEnumerable<Task<TResult>^>^ ParallelForEach(
	IEnumerable<T>^ that, 
	Func<T, TResult>^ action
)

Parameters

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

Type Parameters

TResult
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