I'm attempting to Parallelize the following For Each loop which works as expected. I started with this:
foreach (DataRow drGroup in dsGroups.Tables["Table"].Rows)
ProduceInvoices(drGroup);
and changed it to:
Parallel.ForEach<DataRow>((IEnumerable<DataRow>)dsGroups.Tables["Table"].Rows, ProduceInvoices)
however ProduceInvoices
seem to no longer get executed, despite dsGroup containing rows.
Please can you provide me with any pointers and/or where to look?