ef core power tools many to many

675 Views Asked by At

We're using Entity Framework Core 7 along with EF Core Power tools to reverse engineer our SQL Sever db. We have a many to many relationship in our db: Staff -> Role which in db has a mapping table in between StaffRole.

When running EF core power tools I see it making 3 tables, one of each, with Staff having a Collection of StaffRoles and StaffRole has a link to both Staff and Role. Role again has a Collection of StaffRoles.

I wanted to use Skip Navigation to avoid the StaffRole link being there in both Staff and Role, is that possible with EF Core PowerTools? I have the "Use many to many entity (EF Core 6 or later)" option.

Screenshots (here the option is unchecked, but same results if checked or unchecked): enter image description here enter image description here enter image description here

TbStaff has: enter image description here

TbRole has: enter image description here

DbContext OnModelCreating has the below for the TbStaffRole table: enter image description here

1

There are 1 best solutions below

4
On

Yes, just uncheck that option and you will not get the extra entity generated.