Max causes QueryClientEvaluationWarning #9726
Labels
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
type-bug
Milestone
Using Max in a Linq query causes QueryClientEvaluationWarning to be thrown but if not configured to throw on this warning then looking at the generated SQL I can see that the Max is actually done on the server, not on the client.
My code:
The generated SQL (seen in log and profiler) when not throwing on warning:
Exception message when configured to throw on warning:
Warning as error exception for warning 'Microsoft.EntityFrameworkCore.Query.QueryClientEvaluationWarning': The LINQ expression 'Max()' could not be translated and will be evaluated locally. To suppress this Exception use the DbContextOptionsBuilder.ConfigureWarnings API. ConfigureWarnings can be used when overriding the DbContext.OnConfiguring method or using AddDbContext on the application service provider.
Further technical details
EF Core version: 2.0.0 (and latest 2.1.0 preview)
Database Provider: Microsoft.EntityFrameworkCore.SqlServer
Operating system: Windows 10
IDE: e.g. Visual Studio 2017
The text was updated successfully, but these errors were encountered: