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

[SMALL] Fix to #19801 - Query: add validation to warn about required navigations pointing to entity with query filter #21018

Merged
merged 1 commit into from
May 27, 2020

Conversation

maumar
Copy link
Contributor

@maumar maumar commented May 22, 2020

Warning is issued for required navigations for which required side has query filter and the optional side doesn't.
When both sides define query filters we assume they are correct, i.e. we don't peek inside the filters to make sure they are consistent.

Fixes #19801

@maumar maumar changed the title Fix to #19801 - Query: add validation to warn about required navigations pointing to entity with query filter [SMALL] Fix to #19801 - Query: add validation to warn about required navigations pointing to entity with query filter May 22, 2020
@maumar maumar requested a review from a team May 22, 2020 09:12
@maumar maumar force-pushed the fix19801 branch 2 times, most recently from a344fbe to 5ea1743 Compare May 22, 2020 18:51
@maumar
Copy link
Contributor Author

maumar commented May 26, 2020

ping

Copy link
Contributor

@lajones lajones left a comment

Choose a reason for hiding this comment

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

Looks good. Just minor comments.

/// <summary>
/// <para>
/// Required navigation with principal entity having global query filter defined
/// and the principal entity not having a matching filter
Copy link
Contributor

Choose a reason for hiding this comment

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

Principal mentioned twice? Should one of them be declaring?

@@ -1375,6 +1375,10 @@
<value>Conflicting attributes have been applied: the 'Key' attribute on property '{property}' and the 'Keyless' attribute on its entity '{entity}'. Note that the entity will have no key unless you use fluent API to override this.</value>
<comment>Warning CoreEventId.ConflictingKeylessAndKeyAttributesWarning string string</comment>
</data>
<data name="LogPossibleIncorrectRequiredNavigationWithQueryFilterInteraction" xml:space="preserve">
<value>Entitiy '{principalEntityType}' has global query filter defined and is a required end of a relationship with the entity '{declaringEntityType}'. This may lead to unexpected results when the required entity is filtered out. Either use optional navigation or define matching query filters for both entities in the navigation. See https://go.microsoft.com/fwlink/?linkid=2131316 for more information.</value>
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Entitiy -> Entity

…ons pointing to entity with query filter

Warning is issued for required navigations for which required side has query filter and the optional side doesn't.
When both sides define query filters we assume they are correct, i.e. we don't peek inside the filters to make sure they are consistent.

Fixes #19801
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.

Query: add validation to warn about required navigations pointing to entity with query filter
2 participants