title: Linq Groupby and OrderByDescending can't be translated in .NET Core
body: <p>I'm migrating my application from .NET to .NET Core. However, the .NET Core 3.1 application reports <code>OrderByDescending(x =&gt; x.Time)</code> can't be translated while it works fine in .NET framework.</p>
  <p>How could I fix this issue?</p>
  <pre><code>var prevlist = _db.Botstatus
                    .Where(x =&gt; x.Time &lt; starttime &amp;&amp; x.Status != null)
                    .GroupBy(x =&gt; x.deviceId)
                    .Select(x =&gt; x.OrderByDescending(y =&gt; y.Time)
                    .FirstOrDefault())
                    .ToList();
  </code></pre>
  <p><a href="https://i.stack.imgur.com/Z6JVm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Z6JVm.png" alt="enter image description here" /></a></p>
  <p>Any suggestion would be appreciated! Thanks in advance</p>