Created
October 21, 2018 10:58
-
-
Save mariusGundersen/b552f99f4f2703a00b461c1ce4d11df0 to your computer and use it in GitHub Desktop.
Revisions
-
mariusGundersen created this gist
Oct 21, 2018 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ using System.Runtime.CompilerServices; using System.Threading.Tasks; // Example 2: await anything public static TaskAwaiter<T> GetAwaiter<T>(this T nonAwaitable) => Task.FromResult(nonAwaitable).GetAwaiter(); // Now we can write code like this await "Hello world"; await 100; await true;