Exemplo n.º 1
0
        private async static void AsyncOperation()
        {
            var client = new Proxy("AsyncService");
            Console.WriteLine("Calling AsyncService DoThings(withStuff)");
            var task = Task.Factory.StartNew(() => client.PerformOperation("DoThings(withStuff)"));

            var str = await task;
            str.ContinueWith(e =>
            {
                if (e.IsCompleted)
                {
                    Console.WriteLine(str.Result);
                }
            });
            
            Console.WriteLine("Waiting for the result");
        }