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

Query: QueryFilters/Defining queries are not applied recursively #13361

Closed
smitpatel opened this issue Sep 18, 2018 · 5 comments
Closed

Query: QueryFilters/Defining queries are not applied recursively #13361

smitpatel opened this issue Sep 18, 2018 · 5 comments
Assignees
Labels
breaking-change closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Milestone

Comments

@smitpatel
Copy link
Contributor

As described in #11803, query filters (and also defining queries included), are not applied recursively. Fix for that issue apply recursion at expansion time but it became quite limited in terms of what it can do. Specifically following issues were ignored

Effectively the fix only made it possible to apply recursively only when referencing direct dbset or dbquery of entitytype without any annotation.

Fixing this requires us to apply few operations like extract annotations, nav expansion, query optimizer on expanded part and apply it recursively. Currently it is too fragile to effectively arrive at terminating condition (due to relinq's in-place QueryModel mutation).
Hence reverting the fix for #11803

@ajcvickers
Copy link
Contributor

Note from triage: we are okay with a new cache entry when the filter is disabled.

@ajcvickers
Copy link
Contributor

We should at least make sure it throws for 3.0 instead of returning incorrect results.

maumar added a commit that referenced this issue Jun 28, 2019
Also, fix to #13361 - Query: QueryFilters/Defining queries are not applied recursively

When nav rewrite constructs new EntityQueryable it now looks into EntityType for any query filter annotations and applies them on top. Those predicates are parameterized and the parameters created are injected into the context as part of query execution expression.

Query filters also fundamentally change how nav expansion creates new navigations - before navigations were being added one by one, so we could easily build the NavigationTree by a new node representing given INavigation.
With query filters, the newly created navigation may contain arbitrarily complex NavigationTree structure already (if the query filter itself has some navigations).
To support that, when we create new EntityQueryable for join or collection navigation, we need to visit it (creating NavigationExpansionExpression) and merge the resulting NavigationTree with the previous navigation tree.
@ajcvickers ajcvickers modified the milestones: 3.0.0, Backlog Jun 28, 2019
@AndriySvyryd
Copy link
Member

@maumar Is this fixed/not needed now?

@smitpatel
Copy link
Contributor Author

I believe fixed.

@maumar maumar added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Aug 22, 2019
@maumar maumar modified the milestones: Backlog, 3.0.0 Aug 22, 2019
@maumar
Copy link
Contributor

maumar commented Aug 22, 2019

fixed indeed, closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-bug
Projects
None yet
Development

No branches or pull requests

4 participants