Exemple #1
0
        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");
 }
Exemple #4
0
        public async void _03()
        {
            var value = await DoAsyncStuff.CalculateSumAsync(5, 6);

            Assert.Equal(11, value);
        }
Exemple #5
0
        public void _01()
        {
            Task <int> task = DoAsyncStuff.CalculateSumAsync(5, 6);

            Assert.Equal(11, task.Result);
        }
Exemple #6
0
    static void Main()
    {
        Task <int> value = DoAsyncStuff.CalculateSumAsync(5, 6);

        Console.WriteLine("Value: {0}", value.Result);
    }