Is there an equivalent to 'continue' in a Parallel.ForEach?
return;
(the body is just a function called for each item)
When you converted your loop into a compatible definition for the Parallel.Foreach logic, you ended up making the statement body a lambda. Well, that is an action that gets called by the Parallel function.
So, replace continue
with return
, and break with Stop()
or Break()
statements.