Click or drag to resize
CMSParallel.ForEach<TSource> Method (IEnumerable<TSource>, Action<TSource>, ParallelOptions, Int32)
Executes a for each operation on an System.Collections.IEnumerable{TSource} in which iterations may run in parallel. Wraps the operation into CMSThread to ensure proper context.

Namespace: CMS.Base
Assembly: CMS.Base (in CMS.Base.dll) Version: 12.0.0
Syntax
C#
public static ParallelLoopResult ForEach<TSource>(
	IEnumerable<TSource> source,
	Action<TSource> body,
	ParallelOptions options = null,
	int count = 2147483647
)

Parameters

source
Type: System.Collections.Generic.IEnumerable<TSource>
Parallel sources
body
Type: System.Action<TSource>
Executing body
options (Optional)
Type: System.Threading.Tasks.ParallelOptions
Options for executing
count (Optional)
Type: System.Int32
Number of the items that will be executed. If set, optimizes the performance in case there is none or one items in the source.

Type Parameters

TSource

Return Value

Type: ParallelLoopResult
See Also