I Have a function that looks like this:
public async Task<decimal> GoToWeb(string Sym){}
what’s the best way to call it over a list of strings?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here’s an article from MSDN on using
async-awaitto process multilpe tasks in parallel. And here’s another that specifically addresses a collection of tasks.In short, you can do one of the following:
Start all of your tasks and then
awaiteach of them. They will all run in parallel and your program will continue once they all complete.Put your tasks into a collection and then use
awaitTask.WhenAllto wait for multiple tasks.An example of the second method would be as follows: