CSNet40TPLSample.Program.ExecuteAsyncMethod C# (CSharp) Method

ExecuteAsyncMethod() private static method

private static ExecuteAsyncMethod ( ) : void
return void
        private static void ExecuteAsyncMethod()
        {
            var fb = new FacebookClient();
            var task = fb.GetTaskAsync("/4");

            task.ContinueWith(
                t =>
                {
                    if (t.Exception == null)
                    {
                        dynamic result = t.Result;
                        Console.WriteLine("Name: {0}", result.name);
                    }
                    else
                    {
                        Console.WriteLine("error occurred");
                    }
                });
        }
    }