Timeline for How and when to use ‘async’ and ‘await’
Current License: CC BY-SA 4.0
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Feb 19, 2020 at 16:22 | history | edited | Eliahu Aaron | CC BY-SA 4.0 |
Improved formatting
|
| Jan 16, 2020 at 16:17 | comment | added | Christiano Kiss |
I think the return 1 part deserves some further explanation: the await keyword allows you to return the underlying type of Task<T> directly, thus making it easier to adapt your exiting code to the await/async world. But you don't have to return a value, as it is possible to return a Task without specifying a returning type, which would be the equivalent of a synchronous void method. Mind that C# allows async void methods, but you should avoid doing so unless you're tackling event handlers.
|
|
| Oct 28, 2019 at 14:35 | comment | added | Kuba Do | @StudioX i think it must have return type integer | |
| Nov 23, 2018 at 7:07 | comment | added | Saghachi | and what's the usage of (return 1)? is it necessary? | |
| Nov 23, 2018 at 7:05 | comment | added | Saghachi | "Press any key to exit..." will be showed in which part of output? | |
| Aug 13, 2015 at 9:32 | history | answered | sppc42 | CC BY-SA 3.0 |