Dealing with Many-to-Many Relationships

Sep 1, 2008 at 10:28 AM
Hi, how does the framework deal with many-to-many relationships? I am using the framework against a database where I have two tables, each with their own primary key, but joined by a lookup table which has no primary key of its own. In a previous discussion on this subject, you said that you hoped a solution would be in place for version 2.0, but I have version 3.0 and it does not appear to be fixed.
Sep 1, 2008 at 2:31 PM

You are correct - we put nothing in specifically for Many-To-Many relationships at this point. If you set the two fields in your lookup table as the primary key for that table (or add another key), you can get to the many to many relationship through that table.

For example, if you have these three tables: Employees, Clients and a table managing which employees have talked to which clients (EmployeeClientContacts), from the Employee object, you can go employee.EmployeeClientContacts to get the list - then each one of those has a .Customer property that contains the customer.

It's not as seemless as a true many-to-many relationship, but it also allows you to manage any meta data in the link table, so that's what we stuck with for now.