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

Cosmos: Translate non-persisted property in query when possible #17670

Open
smitpatel opened this issue Sep 7, 2019 · 1 comment
Open

Cosmos: Translate non-persisted property in query when possible #17670

smitpatel opened this issue Sep 7, 2019 · 1 comment
Labels
area-cosmos area-query punted-for-7.0 Originally planned for the EF Core 7.0 (EF7) release, but moved out due to resource constraints. type-enhancement
Milestone

Comments

@smitpatel
Copy link
Member

firstOperator = context.Set<Vehicle>().Select(v => v.Operator).OrderBy(o => o.VehicleName).First();

Here Operator.VehicleName is FK to Vehicle hence not persisted to database. Which fails to translate.

@smitpatel
Copy link
Member Author

Notes:
Non-persisted properties in projection should only materialize. They don't always need to be translated especially the ones where we don't know logic to compute them (user configured value generation).
For the non-persisted properties where we know how to compute values

  • Id => would just refer to id key value on server side.
  • jObject => materialize only in projection, will fail in other places as there shouldn't be a need to use it directly (yet).
  • FK property of nested owned objects - translate it to principal key access as it will be in scope. May not always possible to write this in LINQ if there is no owned to owner navigation so may need some magic in translation.
  • Ordinal of owned collection - Failing translation for now. There is no direct function for computation in server and easy to put values by user on client as needed.

@ajcvickers ajcvickers modified the milestones: Backlog, 7.0.0 Oct 27, 2021
@ajcvickers ajcvickers added punted-for-7.0 Originally planned for the EF Core 7.0 (EF7) release, but moved out due to resource constraints. and removed propose-punt labels Jul 7, 2022
@ajcvickers ajcvickers modified the milestones: 7.0.0, Backlog Jul 7, 2022
@smitpatel smitpatel removed their assignment Sep 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-cosmos area-query punted-for-7.0 Originally planned for the EF Core 7.0 (EF7) release, but moved out due to resource constraints. type-enhancement
Projects
None yet
Development

No branches or pull requests

4 participants