Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

How I can read for 10 images two api call the most efficient foreach(item in collection)    {        output 1 = await await Client.GetStringAsync(url1)        output2 =  await Client.GetStringAsync(url2) }

$
0
0

Hello,

I have a IEnumerable<string> that contains objectNumbers.

Now for each objectNumber I have to read two different api endpoints.

If I have read both I will filter some data out of both and sends it to a view.

But my question is how can I do the calling and fetching the best

I now do :

  

foreach(item in collection)   {       output 1 = await await Client.GetStringAsync(url1)       output2 =  await Client.GetStringAsync(url2)
} 

but then it takes some 3 - 4 seconds to fetch and filter all the data.

So can I do this more effcient so it will costs me around 1 sec maybe.

Regards,

Roelof


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>