-
Notifications
You must be signed in to change notification settings - Fork 545
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
Query Execution (Client/Server) - determination logic and perhaps notification/logging of the same - Hacks? #1963
Comments
@ajcvickers @ErikEJ @AndriySvyryd Could anyone of you please share some insight on this? |
Port your queries and run your integration test suite against a real database. |
Not sure what you meant with “Port your queries”, sorry? I am looking for a solution with EF6 itself and Not with EF Core, if you were suggesting to use EF Core and run the queries there. @ErikEJ any suggestions? |
@ErikEJ @ajcvickers @AndriySvyryd @smitpatel Basically, all your customers who have been using EF6 and want to migrate to EF Core (v3 onwards, preferably v6 or v7) need some tool which can provide information about Query's execution behavior (what part got evaluated at the Client side and what on the server side). A very similar and useful tool was there in the Telerik's Data Access Could we not have such tool available for the customers who are migrating to EF Core world? Or at least give us some insights, so that we can build something very similar (either in EF6 (preferably) or EF Core v6)? @powermetal63 Do you have any ideas on the above? |
Can you please refer to this specific ask recurring in user issues? Irrespective of migration from EF6 to EF Core, a tool to identify the server/client eval part separately in a query may be interesting but not much useful to end customers as long as what EF does under the hood is correct performant results. |
@smitpatel This thread and other queries around migration (EF6 to EF Core) are there only since there is a lack of clarity as to what will still be failing in newer version of EF Core. The statement "We have plan to address some of these in dotnet/efcore#24106" solves only half of the problem statement but does not shed light on what all things will still continue to fail (as against EF6). 1.) If by any chance we have a list of LINQ queries that used to work in EF6 and will not work in EF Core (even after v7 release) then we can actually try and focus only on those LINQs and try to find some work-around so that our Product's upgrade does not get hamper 2.) I agree that client side eval principle being similar in EF6 and EF Core, but since it is been disabled in EF Core (v3 onwards) we need to have a mechanism (code-based not by integration test suits) to determine the failing LINQ scenarios Hence, if you could guide us on code base (EF6/EF Core) to areas where we could find such scenarios and flag them (by making changes and creating custom EF6/EFCore code base only for our use case) - that will make our migration full proof. That is the only thing we are trying to figure out and asking you guys around. |
@smitpatel I tried a simple sample from here msdn
The above runs perfectly fine with EF Core v7.0.0-preview.2.22153.1 but throws System.NotSupportedException with EF6 v6.4.4 Exception: Stack Trace:
@ErikEJ @ajcvickers Going by your statement the above query is an example of "Top-Level Projection" which should have allowed client-side evaluation but fails in EF6, why? Expecting a sooner response this time, thank you! |
@smitpatel Could you please respond on the above query? |
I don't think anything has changed fundamentally in this issue from what I have responded last time here.
As for specific ask for a tool to tell if query will evaluate on client or server without actually writing such query, we cannot provide such tool. Not only there is not frequent ask for it (most customers wants that their query runs when migrating rather than caring about where does it evaluate what), from the infinite problem space of LINQ query world, I believe it is impossible to arrive at a tool which can accurately identify such behavior. Unless there is compelling reason to implement such tool and actually a logical solution which shows that such a tool can work correctly in most case (even if not accurately in 100% cases), we can look into it. |
I was wondering if there is a way to figure out whether my Linq queries were evaluated at the client or the server side, may be via some flag, logs etc. in EF6 world?
Objective: We are in the process of migrating from EF6 to EFCore 6 and since client side evaluation is disabled in EFCore_v6, hence we need to know what all queries will fail to be exported from EF6.
I came across the below codes in EF6 which seems to have some determining logic as to whether the expression is evaluable at the Client or the Server side but I am not sure if that's the only place:
At Funcletizer.cs
And also the below at Translator.cs:
Could you please guide me to something where I can get some indication of whether the LINQ query that I am executing is either getting client evaluated or server evaluated or both (as in some part at client and other at the server end)?
Further technical details
EF version: EF 6.4.0
Database Provider: EntityFramework.SqlServer
Operating system: Windows 10
IDE: Visual Studio 2017
The text was updated successfully, but these errors were encountered: