Esempio n. 1
0
        public Task <string> SecondMethodWithouAwait()
        {
            Console.WriteLine("Second Method without await Start");

            string message = "Test Message - Second Method";

            ThirdThread thirdThread = new ThirdThread();

            Task <string> task = Task.Run(() => {
                Task <string> taskOne = thirdThread.ThirdMethod();
                Console.WriteLine(taskOne.Result + "; without await");
                Thread.Sleep(3000);

                return(message + " - " + taskOne.Result);
            });

            Console.WriteLine("Second Method without await End");

            return(task);
        }