entity framework 4 many to many update
I have 3 tables - User (Id, Name) Roles (Id, Name) UserRoles (UserId, RoleId) I think they are self explanatory. How do I update an entry (UserId and RoleId) in UserRoles? context.User.Roles gives me the list of roles but how do I update them? Thank you. From your comment: context.User.Roles gives me the list of roles. I can do a for-each and update the Id, but how do I update the corresponding UserId foreach RoleId in that table? First of all, you should NOT update the Id's. Secondly, since you are using EF, you should try to think in terms of objects (or entities), rather than "DB-many-to