-
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
[SMALL] Fix to #19801 - Query: add validation to warn about required navigations pointing to entity with query filter #21018
Conversation
a344fbe
to
5ea1743
Compare
ping |
There was a problem hiding this 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 |
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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
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