Horje
c# task call more web api in parallel Code Example
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);
            }




Csharp

Related
username and password into base64 encoding c# Code Example username and password into base64 encoding c# Code Example
calculate 01 with min max value Code Example calculate 01 with min max value Code Example
Running C# Example Code Example Running C# Example Code Example
exceldatareader example c# Code Example exceldatareader example c# Code Example
Unity mousetoterrainposition Code Example Unity mousetoterrainposition Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11