Created
October 29, 2010 11:23
-
-
Save einaros/653358 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| Console.Out.WriteLine("Baking cookies"); | |
| BakeCookies(); | |
| Console.Out.WriteLine("Cookies baked"); | |
| Console.ReadLine(); | |
| } | |
| private static async void BakeCookies() | |
| { | |
| await TaskEx.Run(() => | |
| { | |
| Thread.Sleep(1000); | |
| Console.Out.WriteLine("Done baking"); | |
| }); | |
| } | |
| } | |
| Output: | |
| Baking cookies | |
| Cookies baked | |
| Done baking |
Author
That's entirely possible, but I haven't seen any comments on it in the specs or whitepapers.
That said, I'd much rather have clear naming, than yet more warning and information markers within VS :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
But Visual Studio will draw squiggly lines below non-async calls to async methods, right?