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

EF Core 5 Scaffolding many to many issue #23050

Closed
vsfeedback opened this issue Oct 19, 2020 · 1 comment
Closed

EF Core 5 Scaffolding many to many issue #23050

vsfeedback opened this issue Oct 19, 2020 · 1 comment

Comments

@vsfeedback
Copy link

This issue has been moved from a ticket on Developer Community.


[severity:It bothers me. A fix would be nice]
Hi,
I recently installed and used EF Core 5 (SQLServer + Tools + Design RC2.20475.6) and I tried to use scaffolding on my database.
It appears that a Many to Many joint is missing.
The table has only 2 Ids columns, which are linked to 2 FKs, and... No the result is :
Tables : Enseigne (PK : Id) and Site (PK : Id)

modelBuilder.Entity(entity =>
{
entity. HasKey(e => new { e.IdSite, e.IdEnseigne });

entity. HasOne(d => d.IdEnseigneNavigation)
. WithMany(p => p.EnseignesSite)
. HasForeignKey(d => d.IdEnseigne)
. OnDelete(DeleteBehavior.ClientSetNull)
. HasConstraintName("FK_EnseignesSite_Enseigne");

entity. HasOne(d => d.IdSiteNavigation)
. WithMany(p => p.EnseignesSite)
. HasForeignKey(d => d.IdSite)
. OnDelete(DeleteBehavior.ClientSetNull)
. HasConstraintName("FK_EnseignesSite_Site");
});

Is it a known limitation ?

Thank you !
Erwan


Original Comments

Feedback Bot on 10/15/2020, 06:57 PM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.


Original Solutions

(no solutions)

@ajcvickers
Copy link
Contributor

Duplicate of #22475

@ajcvickers ajcvickers marked this as a duplicate of #22475 Oct 19, 2020
@ajcvickers ajcvickers reopened this Oct 16, 2022
@ajcvickers ajcvickers closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants