Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support translation for new range LINQ APIs #2110

Closed
Logerfo opened this issue Nov 19, 2021 · 1 comment
Closed

Support translation for new range LINQ APIs #2110

Logerfo opened this issue Nov 19, 2021 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@Logerfo
Copy link

Logerfo commented Nov 19, 2021

Source.

Example code

var results = context.Entity.Take(1 .. 2);

Current behavior

System.InvalidOperationException: The LINQ expression 'DbSet() .Take(__p_2)' 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 https://go.microsoft.com/fwlink/?linkid=2101038 for more information. at Microsoft.EntityFrameworkCore.Query.Internal.NavigationExpandingExpressionVisitor.VisitMethodCall(MethodCallExpression methodCallExpression)

Desired behavior

The example code should have the same behavior as the following:

var results = context.Entity.Take(2).Skip(1);

Which translates successfully.

@roji
Copy link
Member

roji commented Nov 19, 2021

Duplicate of dotnet/efcore#24479

@roji roji marked this as a duplicate of dotnet/efcore#24479 Nov 19, 2021
@roji roji closed this as completed Nov 19, 2021
@roji roji added the duplicate This issue or pull request already exists label Nov 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants