title: OrderBy an list in a task function async
body: <p>Okay i am working with orleans and all i really want to do is sort an list after a value in state. i try to this by doing this</p>
  
  <pre><code>public async Task SortEntries()
      {
           State.Entries.OrderBy(GetComparator);
      }
  
      private async decimal GetComparator(IEntryGrain x)
      {
          var a = await x.GetState();
  
          return Task.FromResult(a);
      }
  </code></pre>
  
  <p>but this got two wrongs in them that i am trying to solve. first of the Task SortEntries task lacks an await operator which i guess might still work the problem is that GetComparator says an async method must be void, Task or Task.The most neat way i first thought would be to do all the sorting in SortEntries like this</p>
  
  <pre><code>State.Entries.OrderBy((x) =&gt; x.GetState().Result.TotalPoints);
  </code></pre>
  
  <p>But the GetState() need to be async with an await but i cant do that on the orderBy or sort. Anyone who can push me in the right direction or encountered something similar </p>