-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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 fails with JSON columns and Include collection #28808
Comments
Note for triage: we should consider fixing this for RC1. |
In json shaper, we always assume that the outer entity will be a ParameterExpression, but in case of include it can be resultContext access with conversion. Fix is to relax the CreateJsonShapers method to accept any expression rather than parameter. Edit: issue is bit more complicated than just type change. We only populate the result context after we have visited the entity shaper, but in case of json we are accessing that entity while we are constructing the related json entity shapers. @smitpatel |
that is true.
While this is not. You don't access any actual value when constructing the shaper, you only use the associated parameter/variable. Flow-wise you should only invoke the code which needs the actual instance in generated code only after the entity instance has been created and stored in the result context. Edit: Happy to fix this issue if you want while you are focusing on JSON updates. |
Resolves #28808 The entity instance is in resultContext.Values. We were trying to use it before creating resultContext.Values. Fix is to materialize the includes for JSON after resultContext.Values has been created. The collection include introduces the resultContext.
Resolves #28808 The entity instance is in resultContext.Values. We were trying to use it before creating resultContext.Values. Fix is to materialize the includes for JSON after resultContext.Values has been created. The collection include introduces the resultContext.
This now fails with:
|
Author has a JSON column. Full code below.
The text was updated successfully, but these errors were encountered: