Here is my code:
List<customerModel> rowResults = DataFromCustomersTable();
ParallelLoopResult ploopResult = Parallel.ForEach(rowResults, po, async row =>
{
// Check if customer has a default profile
ResponseResultModel response = await CustomerDefaultSourceTest(row);
// Update table with results from above test
string message = await custData.UpdateResult(row, response);
});
// Loop completed
Both the methods - CustomerDefaultSourceTest
and UpdateResult
have try/catch block.
I removed the try catch from inside the Parallel.ForEach
loop and still only one top row keeps getting processed.