public async void _02() { Task <int> task = DoAsyncStuff.CalculateSumAsync(5, 6); var value = await task; Assert.Equal(11, value); }
static void Main(string[] args) { Task someTask = DoAsyncStuff.CalculateSumAsync(5, 6); someTask.Wait(); Console.WriteLine("Async stuff is done"); }
static void Main(string[] args) { DoAsyncStuff.CalculateSumAsync(5, 6); Thread.Sleep(200); Console.WriteLine("Program Exiting"); }
public async void _03() { var value = await DoAsyncStuff.CalculateSumAsync(5, 6); Assert.Equal(11, value); }
public void _01() { Task <int> task = DoAsyncStuff.CalculateSumAsync(5, 6); Assert.Equal(11, task.Result); }
static void Main() { Task <int> value = DoAsyncStuff.CalculateSumAsync(5, 6); Console.WriteLine("Value: {0}", value.Result); }