Home > Net >  An async and await
An async and await

Time:09-24

I want to know is why await the back of the statement is no longer on the output, how to understand the await here?

CodePudding user response:

Know is what reason, the original is because the main thread ends, the result of the other threads cannot in the Console output, in the Console. After the ReadLine (); Can the normal output,

CodePudding user response:

Well, to me,,,,,,,

CodePudding user response:

Yes, the Main thread to invoke an asynchronous method, if the Main thread ends, nature will not wait to await to receive the return value is out, the Main method can also be identified as async,

CodePudding user response:

Yes, you're right,
You only need to add a console in the main thread, the read () will be waiting for news of the task,
  •  Tags:  
  • C#
  • Related