You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
System.InvalidOperationException: 'The LINQ expression 'DbSet()
.OrderBy(x => x.ReleaseDate)
.TakeLast(__p_0)' 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'.
Hello,
I have the following code:
The code throws an exception:
System.InvalidOperationException: 'The LINQ expression 'DbSet()
.OrderBy(x => x.ReleaseDate)
.TakeLast(__p_0)' 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'.
When I change the code to:
everything works fine.
Data info:
ReleaseDate is type of DateTime, versionsToRemoveCount is type of Int32.
I am not sure if this behavior is correct or it is a bug.
Please take a look into it. Thank you!
EF Core version: 5.0.2
Database provider: Microsoft.EntityFrameworkCore.SqlServer
Target framework: .NET 5.0
Operating system: Windows 10
IDE: Visual Studio 2019 16.10.3
The text was updated successfully, but these errors were encountered: