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 filters docs - using navigations in query filters + sample #2394

Merged
merged 1 commit into from
Jun 10, 2020

Conversation

maumar
Copy link
Contributor

@maumar maumar commented May 19, 2020

No description provided.

@@ -39,6 +39,16 @@ The predicate expressions passed to the _HasQueryFilter_ calls will now automati
> [!NOTE]
> It is currently not possible to define multiple query filters on the same entity - only the last one will be applied. However, you can define a single filter with multiple conditions using the logical _AND_ operator ([`&&` in C#](https://docs.microsoft.com/dotnet/csharp/language-reference/operators/boolean-logical-operators#conditional-logical-and-operator-)).

## Use of navigations

Navigations can be used when defining global query filters. They are applied recursively - when navigations used in query filters are translated, query filters defined on referenced entities are also applied, potentially adding more navigations.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I ditch the explanation what it means that we apply filters recursively? Sentence seems complicated to me, but it ties to the warning about cycles. Thoughts?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems okay to me.

@maumar maumar force-pushed the query_filters branch 2 times, most recently from 1d9fc1f to 3206b47 Compare May 20, 2020 23:29
@maumar
Copy link
Contributor Author

maumar commented May 20, 2020

updated @JeremyLikness can you create a forward link that points to: https://docs.microsoft.com/en-us/ef/core/querying/filters

> [!NOTE]
> Currently EF Core does not detect cycles in global query filter definitions, so you should be careful when defining them. If specified incorrectly, this could lead to infinite loops during query translation.

## Accessing entity with query filter using reqiured navigation
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TMI?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@JeremyLikness
Copy link
Member

@maumar https://go.microsoft.com/fwlink/?linkid=2131316

@maumar
Copy link
Contributor Author

maumar commented May 26, 2020

ping

- using navigations inside query filters,
- using required navigations to acceess entity with query filter defined,
- samples.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants