"c# task call more web api in parallel" Code Answer's
You're definitely familiar with the best coding language C# that developers use to develop their projects and they get all their queries like "c# task call more web api in parallel" answered properly. Developers are finding an appropriate answer about c# task call more web api in parallel related to the C# coding language. By visiting this online portal developers get answers concerning C# codes question like c# task call more web api in parallel. Enter your desired code related query in the search bar and get every piece of information about C# code related question on c# task call more web api in parallel.
c# task call more web api in parallel
foreach (var post in list)
{
async Task<string> func()
{
var response = await client.GetAsync("posts/" + post);
return await response.Content.ReadAsStringAsync();
}
tasks.Add(func());
}
await Task.WhenAll(tasks);
var postResponses = new List<string>();
foreach (var t in tasks) {
var postResponse = await t; //t.Result would be okay too.
postResponses.Add(postResponse);
Console.WriteLine(postResponse);
}
Source: stackoverflow.com
All those coders who are working on the C# based application and are stuck on c# task call more web api in parallel can get a collection of related answers to their query. Programmers need to enter their query on c# task call more web api in parallel related to C# code and they'll get their ambiguities clear immediately. On our webpage, there are tutorials about c# task call more web api in parallel for the programmers working on C# code while coding their module. Coders are also allowed to rectify already present answers of c# task call more web api in parallel while working on the C# language code. Developers can add up suggestions if they deem fit any other answer relating to "c# task call more web api in parallel". Visit this developer's friendly online web community, CodeProZone, and get your queries like c# task call more web api in parallel resolved professionally and stay updated to the latest C# updates.