using System.Threading.Tasks;
public static void Main()
var demo = new AsyncDemo();
public async Task Demo() {
var nothingResult = this.NothingAsync();
Console.WriteLine("nothingResult = {0}", nothingResult);
Console.WriteLine("about to await nothingResult: {0}");
Console.WriteLine("done!");
var waitResult = this.WaitAsync();
Console.WriteLine("waitResult = {0}", waitResult);
Console.WriteLine("about to await waitResult");
Console.WriteLine("done!");
var notReallyAsyncResult = this.NotReallyAsync();
Console.WriteLine("notReallyAsyncResult = {0}", notReallyAsyncResult);
Console.WriteLine("about to await notReallyAsyncResult");
Console.WriteLine("done!");
public async Task NothingAsync()
public async Task WaitAsync()
public Task NotReallyAsync()
return Task.CompletedTask;