I have the below method (it's an extension method but not relevant to this question) and I would like to use `GroupBy` on the results of the method.

```
class MyClass 
{
    public async Task<string> GetRank() 
    {
        return "X";
    }

    public async static Task Test()
    {
       List<MyClass> items = new List<MyClass>() { new MyClass() };
       var grouped = items.GroupBy(async _ => (await _.GetRank()));
    }
}

```

The type of `grouped` is `IGrouping<Task<string>, MyClass>`, however I need to group by the actual awaited result of the async method (string). Despite using await and making the lambda async, I still get `IGrouping<Task<string>, ..>` instead of `IGrouping<string, ...>`

How to use GroupBy and group by a result of async `Task<string>` method and get a grouping by string?