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

Rerun relationship discovery if an ambiguity has been resolved on the inverse #18388

Closed
AndriySvyryd opened this issue Oct 15, 2019 · 1 comment · Fixed by #25263
Closed

Rerun relationship discovery if an ambiguity has been resolved on the inverse #18388

AndriySvyryd opened this issue Oct 15, 2019 · 1 comment · Fixed by #25263
Labels
area-model-building closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported punted-for-5.0 type-bug
Milestone

Comments

@AndriySvyryd
Copy link
Member

AndriySvyryd commented Oct 15, 2019

modelBuilder
    .Entity<A>()
    .HasOne(a => a.B)
    .WithOne();

Should be enough to configure

public class A
{
    public int Id { get; set; }
    public B B { get; set; }
}

public class B
{
    public int Id { get; set; }
    public A A1 { get; set; }
    public A A2 { get; set; }
}

Also run KeyDiscoveryConvention when a property is ignored

And remove from ambiguous inverse navigations when an entity type is removed.

@smitpatel
Copy link
Member

Consider scenario in #18335
where it is collection navigation on both sides. And the other side uses NotMapped to ignore it and resolves ambiguity but we don't discover relationship.

@AndriySvyryd AndriySvyryd modified the milestones: Backlog, 5.0.0 Jan 22, 2020
@ajcvickers ajcvickers modified the milestones: 5.0.0, Backlog Jun 10, 2020
@AndriySvyryd AndriySvyryd modified the milestones: Backlog, 6.0.0 Oct 7, 2020
@AndriySvyryd AndriySvyryd added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Jul 14, 2021
@AndriySvyryd AndriySvyryd removed their assignment Jul 14, 2021
AndriySvyryd added a commit that referenced this issue Jul 14, 2021
… inverse

Rerun KeyDiscoveryConvention when a property is ignored
Remove the associated FK when a skip navigation is removed
Add IForeignKeyNullNavigationSetConvention
Sort IEntityTypeConfiguration applied from assembly

Fixes #18388
Fixes #24521
AndriySvyryd added a commit that referenced this issue Jul 14, 2021
… inverse

Rerun KeyDiscoveryConvention when a property is ignored
Remove the associated FK when a skip navigation is removed
Add IForeignKeyNullNavigationSetConvention
Sort IEntityTypeConfiguration applied from assembly

Fixes #18388
Fixes #24521
AndriySvyryd added a commit that referenced this issue Jul 16, 2021
… inverse

Rerun KeyDiscoveryConvention when a property is ignored
Remove the associated FK when a skip navigation is removed
Add IForeignKeyNullNavigationSetConvention
Sort IEntityTypeConfiguration applied from assembly

Fixes #18388
Fixes #24521
@ajcvickers ajcvickers modified the milestones: 6.0.0, 6.0.0-rc1 Aug 12, 2021
@ajcvickers ajcvickers modified the milestones: 6.0.0-rc1, 6.0.0 Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-model-building closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. customer-reported punted-for-5.0 type-bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants