Last post Feb 24, 2015 08:34 PM by Edwin Guru Singh
Feb 23, 2015 09:16 PM|Alex_808|LINK
I have a conference table. A conference can have a list of associated conferences. Is this what is refereed to as a recursive associations?
And Is this accomplished by having another table ConferenceAssociatedConference with two fields (ConferenceId, AssociatedConferenceId) and these two fields are both foreign keys pointing on the same ConferenceId field of the Conference Table?
I though the above was correct but when creating and building my edmx I get:
Error 6 Error 3034: Problem in mapping fragments starting at lines 875, 982: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.
Feb 24, 2015 08:34 PM|Edwin Guru Singh|LINK
As per your case, I have been shared my ideas below :
For Error 3034 :
The resolution that seems to work for many and to delete the EDMX file and rebuild it.
The only warning is that you must specify the same names in the Wizard or your class names won’t match.
It isn’t worth the trouble to try to rename the classes. If you find that you have changed the class names, you can also delete and rebuild your .tt/.cs files and regenerate them too. At this point, you should have very few class references that are incorrect.
Better you can do this is with a parent/child concept. Add a 'ParentConference' column to your conference table and default it to null.
Conferences can be associated by populating the new column with the ID of the main conference.
This is a common practice for things like tradeshows, which usually have an associated professional conference or seminar series.
The limitation is that it requires one record of any given group to be the parent of the group, which may not fit your needs.
If you don't want to do that, I'd suggest making a ConferenceType table and categorizing your conferences that way. It's easy and much less messy than mucking around with many-to-many flow.