locked
Many to Many Relationship Keys RRS feed

  • Question

  • Hi Everyone,

    I have 2 entity objects (table1 and table3) with a many to many relationship via an intermediary table (table2) containing only the 2 PK/FK keys.

    With the relationship manager I can view the end points of the relationship (table1 and table3) but I need to know the name of "table2" and the names of the PK/FK fields in table2.

    Any ideas?

    Thanks

    Monday, August 16, 2010 7:26 AM

Answers

  • Hi,

    I just got around this problem.(In the database) In table2 add an integer field and set the identity seed. DON'T set it as a key. Set your other two fields as a composite primary key.

    Go into visual studio an add a new entity model. Delete your old entity model. so rather than getting table1->table3 with (->) being the association and not a entity, the entity model will now be created as: table1->table2->table3

    It's a hack but it works. If it goes against any of your principles do not use it as a solution.

    Dragan :)

     

    Monday, August 16, 2010 10:51 AM