The error means you are hitting current EF Core bug or limitation.
.TakeLastand now I get the described error.
So you know what caused the issue. In general avoid LINQ methods having
Last in name (like
TakeLast) - these have no direct equivalent in SQL world, hence have bigger chance to hit bugs/limitations (or just not supported) by query translators.
Instead, invert the ordering and use the corresponding
Applying it to your case means replacing
.OrderBy(d => d.CreatedDate)
.OrderByDescending(d => d.CreatedDate)
- Entity Framework Core - This may indicate either a bug or a limitation in EF Core
- How to improve this Entity Framework Core query?
- Entity Framework Core 3.1.1 Where query could not be translated. Either rewrite the query in a form that can be translated,
- Entity Framework Core 3.1 - Linq - Could not be translated. Either rewrite the query in a form that can be translated
- What could cause a "This may indicate either a bug or a limitation in EF Core." error in a linq expression .net core 3.0?
- Entity Framework core - Contains is case sensitive or case insensitive?
- Entity Framework Core count does not have optimal performance
- Entity Framework 6 Code First Custom Functions
- Use a Inline Table-Valued Functions with Linq and Entity Framework Core
- Why does the order of LET statements matter in this Entity Framework query?
- Entity Framework Core where clause with multiple values
- Avoiding repeated projection code in Entity Framework
- Entity Framework Core : LINQ advise needed on better approach using include for relational tables
- Forcing Entity Framework to not generate NCLOB's when building Linq-to-Sql Code (Model First)
- Entity Framework Core LINQ query with multiple where clauses
- Entity Framework Core : how can I use DateDiff in Linq?
- How do I do this in Entity Framework (multiple where's or Join)?
- Entity Framework Core linq query returns InvalidCastException
- Entity Framework Code First without app.config
- How can I implement a LEFT OUTER JOIN in LINQ using lambda syntax on Entity Framework Core 2.0?
- Why is Entity Framework core loading entity's relations without adding include
- ASP NET CORE Entity Framework Select with GroupBy Id
- Efficient joining the most recent record from another table in Entity Framework Core
- Entity Framework Core - .Contains() - Why escaping instead of parametrization?
- Convert String to DateTime in LINQ query with Entity Framework Core
- Remove duplicated SUM subquery in Entity Framework Core query
- Entity Framework Code First using context in Controller
- many to many mapping in entity framework code first
- Entity Framework Core GroupBy Date
- How to Create a Run-Time Computed (NotMapped) Value in Entity Framework Code First
- Min-Max DataPoint Normilization
- linq with max date in sub query
- C# Backend Pro Is needed ! Data weirdness
- Convert a sequence of arrays T myArray to IEnumerable<T> in c#
- Fastest way to convert NVARCHAR value to XML
- Using xname in Linq-to-xml
- Complex LINQ query
- Is it possible to return IQueryable<SomeClass> to a IQueryable<T> method?
- How do I get the descendants of a named node using Linq-to-XML?
- Is it possible to do this as a single efficient LINQ query?
- Querying sub document Ravendb
- Querying for nullable relationship set of two lists
- Using ref parameters in linq
- Compare Linq Query Result to Array
- Do the Nerd Dinner models use best practices for disposing objects?
- How to write a dynamic Lambda Expression to access Nth Parent entity?
- Multiple or Single Repositories with LINQ
- LINQ to Entities: queryable extension method not reconized inside where condition
- Get items by matching predicate method
- How to use or operator in linq to sql