This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
I have a many2many relationship and encountered two small problems. One Projects table is linked to Users table with a ProjectUsers table. The first problem I found is that apparently Lightspeed doesn't support composite primary keys witch is often the case of the table in the middle in a Many2Many relationship (my ProjectUser table had the primary key composed of the two join fields, I added a new int primary key field for this to work). The second problem is that I'd like to filter with Linq Projects based on the UserName. I tried with the SelectMany operator but got an "unsupported overload used for query operator 'SelectMany'."
|
|
|
Re composite keys: Yes, that is correct: LightSpeed does not support composite keys -- every table, even through tables, must have a single primary key column. Re filtering projects on the user name: The trick here is to go explicitly through the intermediate (ProjectUser) entity and select the Project from the ProjectUser: var projects = UnitOfWork.Users |
|