title: How to use linq group with count and return ToListAsync to front end
body: <p>This is my code. I need to use linq group and count after return to front end by ToListAsync.
  But I got a error like this picture<a href="https://i.stack.imgur.com/sGoqv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sGoqv.png" alt="." /></a>
  How can I fix it?</p>
  <pre><code>    public async Task&lt;List&lt;Product&gt;&gt; GetDataChart()
      {
          var data = await dbMLIMPORT.Product
                      .GroupBy(g =&gt; new { g.CMID, g.SUB_CODE })
                      .Select(s =&gt; new
                      {
                          CMID = s.Key.CMID,
                          SUB_CODE = s.Key.SUB_CODE,
                          COUNT = s.Sum(x =&gt; x.PRODUCT_ID.Length &gt; 0 ? 1 : 0)
                      }).ToListAsync();
          return data;
      }
  </code></pre>