Ejemplo n.º 1
0
        public void MainMethodWithoutAwait()
        {
            Console.WriteLine("Main method without await Start");

            SecondThread  secondThread = new SecondThread();
            Task <string> taskOne      = secondThread.SecondMethodWithouAwait();

            Console.WriteLine(taskOne.Result);

            Console.WriteLine("Main method without await End");
        }
Ejemplo n.º 2
0
        public async void MainMethod()
        {
            SecondThread secondThread = new SecondThread();

            Console.WriteLine("Main method with await Start");

            string message = await secondThread.SecondMethod();

            Console.WriteLine(message);

            Console.WriteLine("Main method with await End");
        }