2
votes

I am using .net 4 and entity framework 4.x

I have 3 tables in sql server. For instance Persons, PersonClasses and Classes

Persons has pk PersonId Classes has pk ClassId PersonClasses has PersonId fk and ClassId fk

After adding to my EDMX i get the following error. How to resolve?

Error 3034: Problem in mapping fragments starting at lines 691, 768: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.

1

1 Answers

3
votes

The only solution I found to this problem was to remove all entities from the model and update the model from database fresh. This worked for me. Potentially something not working so well in the designer after you remove a few tables and replace only those few tables. Not sure at this point.