title: How to call async method in the LINQ Select when creating an object
body: <p>I have some code</p>
  <pre><code>            var battleDetails = await _dbContext.BattleDetails
                  .Select(x =&gt; new 
                  { 
                      x.Hero, 
                      BattlesCount = _dbContext.BattleDetails
                          .Count(y =&gt; y.Hero == x.Hero)
  
                  })
                  .ToListAsync();
  </code></pre>
  <p>And I want to use <code>CountAsync</code> method instead of <code>Count</code>, but when I try to do this I am getting an error.</p>
  <p>I have tried multiple ways, FE</p>
  <pre><code>                .Select(async x =&gt; new 
                  { 
                      x.Hero, 
                      BattlesCount = await _dbContext.BattleDetails
                          .CountAsync(y =&gt; y.Hero == x.Hero)
                  })
  </code></pre>
  <p>What should I do to make it async?</p>