How do I get a return value from Task.WaitAll() in a console app?
问题 I am using a console app as a proof of concept and new need to get an async return value. I figured out that I need to use Task.WaitAll() in my main method to avoid needing an async "main()" method, which is illegal. I'm now stuck trying to figure out an overload that allows me to use generics or just returns an object that I can cast, but while in Main(). 回答1: You don't get a return value from Task.WaitAll . You only use it to wait for completion of multiple tasks and then get the return