Ì am currently working on a ASP NET MVC project. We use Entity Framework and follow the Database First approach. The database already exists. The database has been created using the convention, that every table has a specified single primary key, even if it is a junction table.
Example :
Table User : UserId (PK); Username
Table UserRole : UserRoleId (PK); UserId (FK); RoleId (FK)
Table Role : RoleId (PK); Rolename
As said, the database already exists and this convention is not discussable. When I want to create an Entity Data Model in Visual Studio, I also have three Entities. But it would only make sense to have two Entities: User and Role. The UserRole Entity makes no sense.
Is there any possibility I can influence the way that Entity Framework maps my tables, so I can get rid of those relational (useless) entities?