Where does async and await end? Confusion
问题 I have a program which has no purpose but to help me understand how async and await works. It's a console application which parses XML and waits for a name to be returned, either the surname or the first name. Here is the code: static void Main(string[] args) { Task<string> name = GetFirstParsedName(); name.Wait(); if (name.IsCompleted) { Console.WriteLine(name.Result); } Console.ReadLine(); } static async Task<string> GetFirstParsedName() { string xmlSnippet = @"<person> <FirstName>Chamir<