I was working in L2E with 3 simple tables, whose purposes a fairly straightforward: Users, Users_Roles, Roles.
Users had a 1:many relationship with Users_Roles, referenced on the column UserID (a uniqueidentifier). At the time, Roles had no relation to any tables. I brought all 3 tables into the designer, which reflected the mapping of Users to Users_Roles, while Roles sat all by itself.
Realizing Roles should be mapped to Users_Roles in a many:many relationship, I jumped into management studio. I slapped a relationship from Roles to Users_Roles and saved it. I then jumped back into VS and did the logical the next logical step in my mind - tried to update the Entity model by right-clicking, "Update Model from database". It showed all three tables in its update list. After updating, the visual relationship didn't change. I tried to recompile to see if any changes were made, but received two errors differing only in line numbers:
Error 3 Error 3034: Problem in Mapping Fragments starting at lines 177, 192: Two entities with possibly different keys are mapped to the same row. Ensure these two mapping fragments map both ends of the AssociationSet to the corresponding columns. C:*\Model1.edmx 178 15 MVCTestApp
Tried to debug the error to no avail. Eventually got frustrated, deleted the model and rebuilt it. The relationships were recognized, the designer was update properly, life was good.
This isn't the first time I've wanted to take the designer outside and bury it, either: a week or so earlier I had the nerve to delete a table, and learned very quickly that deleting a table in the designer only deletes it from the designer; its mappings stay.
So, a few questions:
1) is this behavior limited to VS 2008? I'll have 2010 shortly, and am hoping that the designer functions as expected,
2) are there other tools that can replaced the built-in designer that actually work,
3) is there a way to make update from model actually update - perhaps some trick I'm not aware of besides deleting the entire model, thus losing all my other relationships I've set up manually?