-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Return entire entity in projection (select) #17852
Comments
I'm facing this issue when migrated .net core 2.2 to 3.0, here's my query which is buggy after migration:
Error stack:
If I rollback to .net core 2.2, this works perfectly. |
Sorry about spamming which you think, but can you please confirm if this was supported in earlier version of EF Core? We started facing this issue only after migrating from 2.2 to 3.0 and when we rolled back to 2.2 it worked again. |
It was being evaluated on client. Please see https://docs.microsoft.com/en-us/ef/core/what-is-new/ef-core-3.0/breaking-changes#linq-queries-are-no-longer-evaluated-on-the-client |
Issue: Earlier we expanded navigation in selector and include in separate phase. This causes issue because if the latter visitor expands a reference navigation then former visitor's collection expansions have incorrect references. Fix: Fix is to make include expansion part of selector expansion as next phase. So by the time we apply include, the correlation predicate in collection hasn't been converted to actual reference. So when it gets converted, it takes correct reference. Also apply pending selector inside lambda expression since it is a subquery. This caused issue when subquery has a projection which has navigation to expand, which we never visited. Resolves #18127 Resolves #18090 Resolves #17852 Resolves #17756
Issue: Earlier we expanded navigation in selector and include in separate phase. This causes issue because if the latter visitor expands a reference navigation then former visitor's collection expansions have incorrect references. Fix: Fix is to make include expansion part of selector expansion as next phase. So by the time we apply include, the correlation predicate in collection hasn't been converted to actual reference. So when it gets converted, it takes correct reference. Also apply pending selector inside lambda expression since it is a subquery. This caused issue when subquery has a projection which has navigation to expand, which we never visited. Resolves #18127 Resolves #18090 Resolves #17852 Resolves #17756
Issue: Earlier we expanded navigation in selector and include in separate phase. This causes issue because if the latter visitor expands a reference navigation then former visitor's collection expansions have incorrect references. Fix: Fix is to make include expansion part of selector expansion as next phase. So by the time we apply include, the correlation predicate in collection hasn't been converted to actual reference. So when it gets converted, it takes correct reference. Also apply pending selector inside lambda expression since it is a subquery. This caused issue when subquery has a projection which has navigation to expand, which we never visited. Resolves #18127 Resolves #18090 Resolves #17852 Resolves #17756
Issue: Earlier we expanded navigation in selector and include in separate phase. This causes issue because if the latter visitor expands a reference navigation then former visitor's collection expansions have incorrect references. Fix: Fix is to make include expansion part of selector expansion as next phase. So by the time we apply include, the correlation predicate in collection hasn't been converted to actual reference. So when it gets converted, it takes correct reference. Also apply pending selector inside lambda expression since it is a subquery. This caused issue when subquery has a projection which has navigation to expand, which we never visited. Resolves #18127 Resolves #18090 Resolves #17852 Resolves #17756
Issue: Earlier we expanded navigation in selector and include in separate phase. This causes issue because if the latter visitor expands a reference navigation then former visitor's collection expansions have incorrect references. Fix: Fix is to make include expansion part of selector expansion as next phase. So by the time we apply include, the correlation predicate in collection hasn't been converted to actual reference. So when it gets converted, it takes correct reference. Also apply pending selector inside lambda expression since it is a subquery. This caused issue when subquery has a projection which has navigation to expand, which we never visited. Resolves #18127 Resolves #18090 Resolves #17852 Resolves #17756
Issue: Earlier we expanded navigation in selector and include in separate phase. This causes issue because if the latter visitor expands a reference navigation then former visitor's collection expansions have incorrect references. Fix: Fix is to make include expansion part of selector expansion as next phase. So by the time we apply include, the correlation predicate in collection hasn't been converted to actual reference. So when it gets converted, it takes correct reference. Also apply pending selector inside lambda expression since it is a subquery. This caused issue when subquery has a projection which has navigation to expand, which we never visited. Resolves #18127 Resolves #18090 Resolves #17852 Resolves #17756
Is it possible to return the entire entity in a projection or to only selectively get specific properties? If the latter, I guess this becomes a feature request since it's tedious to get every single property and have to keep that up-to-date.
Steps to reproduce
The line:
Blog = x
causes an exception:EF.Property called with wrong property name.
Stacktrace
Further technical details
EF Core version: 3.0 preview 9
Database provider: SQLite
Target framework: .NET Core 3.0
Operating system: Win 10
IDE: Visual Studio 2019 16.2.4
The text was updated successfully, but these errors were encountered: