I have a problem, I think it works well for concurrency, but I donβt know exactly how to express it in C #. Usually in this program I run an expensive test on several objects. I am testing to make sure βI can go ahead,β so I need to know if any of these tests have passed. However, if any test fails, the whole thing fails, and the whole function should be a guarantee. In pseudo code:
...
var guys = getGuysToProcess().ToList();
foreach (myGuys guy in guys) {
if (!guy.TestForPossibleBadness())
return false;
}
Which C # template is the best I would like to express this and test them all in parallel? If any of them fails, other tests should be discontinued, as their result does not matter.
source
share