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

MemberEntry support for skip navigations #21940

Closed
wants to merge 1 commit into from
Closed

Conversation

ajcvickers
Copy link
Contributor

Part of #19003

/// <summary>
/// Gets the metadata that describes the facets of this property and how it maps to the database.
/// </summary>
public new virtual INavigation Metadata
Copy link
Contributor Author

@ajcvickers ajcvickers Aug 5, 2020

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)
Copy link
Contributor Author

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.

@ajcvickers ajcvickers requested a review from a team August 5, 2020 16:21
var navigation = Metadata as INavigation;
var navigationValue = CurrentValue;

if (Metadata.IsCollection)
Copy link
Member

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))))
Copy link
Member

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?

Copy link
Contributor Author

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...

Copy link
Member

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
Copy link
Member

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
{
Copy link
Member

Choose a reason for hiding this comment

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

Move this to CollectionEntry

@ajcvickers ajcvickers closed this Aug 6, 2020
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.

2 participants