-
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
MemberEntry support for skip navigations #21940
Conversation
/// <summary> | ||
/// Gets the metadata that describes the facets of this property and how it maps to the database. | ||
/// </summary> | ||
public new virtual INavigation Metadata |
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.
This is a breaking change, but I think it will have minimal impact.
=> Query(navigation, entry); | ||
|
||
private static object[] GetLoadValues(INavigation navigation, InternalEntityEntry entry) | ||
private static object[] GetLoadValues(INavigationBase navigation, InternalEntityEntry entry) |
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.
Fixing the loader for skip navigations is next on my list.
var navigation = Metadata as INavigation; | ||
var navigationValue = CurrentValue; | ||
|
||
if (Metadata.IsCollection) |
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.
Move this to CollectionEntry
&& (relatedEntry.EntityState == EntityState.Added | ||
|| relatedEntry.EntityState == EntityState.Deleted | ||
|| (navigation != null | ||
&& navigation.ForeignKey.Properties.Any(relatedEntry.IsModified)))) |
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.
Shouldn't we also check the state of the join entities for skip navs?
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.
Yes, good catch. I'm mad at myself because I realized that last night, but apparently by this morning I forgot...
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.
Don't send out PRs just before community standup 😄
} | ||
set | ||
{ | ||
if (Metadata.IsOnDependent) | ||
var foreignKey = Metadata is ISkipNavigation skipNavigation | ||
? skipNavigation.Inverse.ForeignKey |
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.
Shouldn't we mark both FKs as modified?
@@ -213,51 +240,46 @@ public override bool IsModified | |||
{ |
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.
Move this to CollectionEntry
Part of #19003