Explore Library
Code QuizAdvanced

Missing await in async method

Spotting the classic forgotten-await bug in a Task-based async method.

Codecsharp
public async Task<string> GetUserNameAsync(HttpClient client)
{
    Task<string> request = client.GetStringAsync("https://api.example.com/user");
    string result = request.Result;
    return result;
}

What is the bug in this async method?