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

Many to Many, Hide One collection Navigation property #27658

Closed
julienGrd opened this issue Mar 17, 2022 · 1 comment
Closed

Many to Many, Hide One collection Navigation property #27658

julienGrd opened this issue Mar 17, 2022 · 1 comment

Comments

@julienGrd
Copy link

Hello guys, in my model im able to do something like that for example to load only one side of a relation

 entity.HasOne(d => d.Coord)
                    .WithMany()
                    .HasForeignKey(d => d.CoordID)
                    .HasConstraintName("FK_Enfant_Coord");

It allow me to load the object Coord without have the all collection on the other side

I would like to have the same for many to many relation but it seem i don't have the method WithMany with null parameter

entity.HasMany(d => d.Fns)
                    .WithMany()//compilation error
                    .UsingEntity<Dictionary<string, object>>(
                        "QlQuestsFn",
                        l => l.HasOne<Fn>().WithMany().HasForeignKey("FnNum").OnDelete(DeleteBehavior.ClientSetNull).HasConstraintName("FK_QlQuestFn_Fn"),
                        r => r.HasOne<QlQuest>().WithMany().HasForeignKey("QlNum").OnDelete(DeleteBehavior.ClientSetNull).HasConstraintName("FK_QlQuestFn_Ql"),
                        j =>
                        {
                            j.HasKey("QlNum", "FnNum").HasName("PK_QlQuestFn");

                            j.ToTable("QlQuests_Fns");
                        });

How i Can achieve what i want ? is it possible now ?

thanks !

@ajcvickers
Copy link
Member

Duplicate of #3864.

@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