why this method doesn't output anything? I did the same thing with the threads and it worked but this way doesn't wok. Do am I missing something?
foreach(var i in arr)
await Task.Run(() => {
Task.Delay(i * 100);
Console.WriteLine(i);
});
Rajanikant HawaldarPosted Sep 23, 2022, 1:21 PM
Use Parallel.Foreach
Vishal JoshiPosted Sep 23, 2022, 6:02 AM
Hello
You need to add wait at the end. please find below the code for the sample.