How to use await in a parallel foreach?
问题 So I sepnt the better part of the night trying to figure this out. I was fortunate to get introduced to the parallel.foreach yesterday and it works like I want it to do except from one detail. I have the following: Parallel.ForEach(data, (d) => { try { MyMethod(d, measurements); } catch (Exception e) { // logg } }); Within the method "MyMethod" I have alot of logic that gets done and most of it is fine but I make api calls where I fetch data and I use async task for this to be able to use