I have three table in SQL database such as table Person has relation one to many to table member and number has one to many relation to table member .that means member table in this design is junction table and i want do many to many relation between person table and number table for removing member table .but i cant because when i do relation between person and number in my EDMX file and Generate the EDMX model to SQL database .the sql database creates a table between person table and number table has two field such as personId and numberId. i want add Some field to junction table that removed between two tables.for example i need firstname or last name in junction table that i removed .how i alternative a junction table to many to many relation between two table in my EDMX file that the junction table has more field?
Share
If you are using database first simply add all columns you need in junction table and update model from database. EDMX will contain a new
Memberentity.If you are using model first you cannot use many to many relation between
PersonandNumber. You must model three entities –Person,MemberandNumberwith the same relations you expect in the database. Once you use generated database from model you will get the database you expect.Many-to-many relation with hidden junction table in EDMX is only for scenarios where you have a real junction table without any additional data columns.