Reputation: 3946
Considering this database:
This is what EF generates:
I think that HeroesItem class, is useless, and there should be a navigation property Items on Hero class and a navigation property Heroes on Item class.
I saw this can be done easily with code first, but how to get it done using database first?
Upvotes: 0
Views: 69
Reputation: 364409
It can be done only if your HeroesItems
table does not contain Id
column and instead uses IdHero
and IdItem
as composite primary key. Once you add any additional column to junction table you must map it as entity to have control over that column.
Upvotes: 1