title: InvalidOperationException: The LINQ expression 'GroupByShaperExpression:
body: <pre><code>fileMovementRepository.GetAll()
                      .Where(fm =&gt; repository.GetAll().Select(f =&gt; f.Id).Contains(fm.FileId) &amp;&amp; fm.TransferredById == userId)
                      .Include(f =&gt; f.User).Include(f =&gt; f.File).ThenInclude(f =&gt; f.Category)
                      .OrderByDescending(f =&gt; f.MovedOn)
                      .GroupBy(f =&gt; f.FileId)
                      .Select(f=&gt;f.First())
                      .ToList();
  </code></pre>
  <p>The following error is showing on runtime</p>
  <p>An unhandled exception occurred while processing the request.
  InvalidOperationException: The LINQ expression 'GroupByShaperExpression:
  KeySelector: f.FileId,
  ElementSelector:EntityShaperExpression:
  EntityType: FileMovement
  ValueBufferExpression:
  ProjectionBindingExpression: EmptyProjectionMember
  IsNullable: False</p>
  <p>.First()' could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to 'AsEnumerable', 'AsAsyncEnumerable', 'ToList', or 'ToListAsync'. See <a href="https://go.microsoft.com/fwlink/?linkid=2101038" rel="nofollow noreferrer">https://go.microsoft.com/fwlink/?linkid=2101038</a> for more information.
  Microsoft.EntityFrameworkCore.Query.RelationalSqlTranslatingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)</p>
  <p>InvalidOperationException: The LINQ expression 'GroupByShaperExpression: KeySelector: f.FileId, ElementSelector:EntityShaperExpression: EntityType: FileMovement ValueBufferExpression: ProjectionBindingExpression: EmptyProjectionMember IsNullable: False .First()' could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to 'AsEnumerable', 'AsAsyncEnumerable', 'ToList', or 'ToListAsync'. See <a href="https://go.microsoft.com/fwlink/?linkid=2101038" rel="nofollow noreferrer">https://go.microsoft.com/fwlink/?linkid=2101038</a> for more information.</p>