Entity Framework: Many to Many Relationship
问题 I have two tables with a Many-To-Many relationship like this: User( emailaddress , Name) UserAlerts( emailaddress , AlertId ) Alert( AlertId ,Title) Alerts have already been added to the database. When inserting a new user, I am doing a lookup on the AlertRepository . The problem is, Instead of creating a record in the User and the UsertAlerts tables only, its also adding an extra Alert record. I am using the following code: public ActionResult Register(UserModel model, int[] Alerts) User