Click or drag to resize
CMSParallelForEachTSource Method (IEnumerableTSource, ActionTSource, 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: 10.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.GenericIEnumerableTSource
Parallel sources
body
Type: SystemActionTSource
Executing body
options (Optional)
Type: System.Threading.TasksParallelOptions
Options for executing
count (Optional)
Type: SystemInt32
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