Many to many to self

Jun 24, 2011 at 3:53 PM


Will the solution M2M4Ria work on the table that has self reference with many to many multiplicity.

Reason for asking is that I have created a model, self referenced a table and cannot make it compile (I do have other M2M relationships in the EF model (not self referencing), which seem to work fine. However, self referencing table complains about the following:

for simplicity I'll call the self referencing table - "TBL" and its key - "KEY" (Int32). Obviously many to many table name is TBLTBL. While generating the database script and running the custom tool I get these errors in this order:

1. TBLTBL already contains definition of _KEY (underscore is there on purpose - it shows this way in the error message)

2. TBLTBL already contains definition of KEY

3. TBLTBL already contains a definition of TBL

Please let me know your thoughts and my actions to troubleshoot it, currently I don't really know how to continue


Jun 27, 2011 at 12:02 PM


Thanks for trying m2m4ria and for reporting this issue.

Unfortunately, I can't help you in the coming weeks because I'll be away for a while.

Once I get back I'll have a look it this issue.

I'm sorry I can't help you earlier.



Aug 2, 2011 at 11:46 AM


Sorry again for the delay. I've just added (and committed) the necessary changes to m2m4ria to support self-referencing m2m relations.

Best regards,


Aug 2, 2011 at 11:49 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.