I've a problem with parallel.foreach and async combination. Here is my code -
new Thread(() =>{
//doing some stuff here
Parallel.ForEach(.....,ParallelOption,async(j,loopState) =>
{
//await some stuff here like:
// HttpResponseMessage res = await httpClient.GetAsync(url);
// UpdateUI
}
}).Start();
Now, my problem is how can I be sure of the loop has completed all jobs? It just ends in few seconds but UIUpdateing will continue for much more time.
How its possible to wait for the await httpClient.GetAsync(url)
to complete and then update the UI?