c# exit parallel for code example
Example: how to break out of parallel.foreach
Parallel.ForEach(list,
(i, state) =>
{
state.Break();
});
Parallel.ForEach(list,
(i, state) =>
{
state.Break();
});