Cautionary Tale – Do not use async lambda expression in Parallel.ForEach()
Recently, I have fixed one very strange bug and want to share this cautionary tale of using async lambda expression inside Parallel.ForEach() loop. Context In the code base, we have a Parallel.ForEach() that look something like this: Imagine SomeWorkAsync() being some sort of I/O work, like inserting data to a database. The issue we observe […]