I'm working with a bit of a legacy database, but here's the basic idea:
Item
Id INT PK NOT NULL
Description VARCHAR(50) NOT NULL
TranslationId INT NULLABLE
Translation
Id INT PK NOT NULL
Language VARCHAR(10) PK NOT NULL
Translation VARCHAR(50) NOT NULL
Basically every Item MAY have many Translations, seems simple enough. These tables don't have foreign keys, so I'm manually trying to create the association in the DBML, however it fails because of the NULL difference between translationID and the PK in the Translation table.
Is there anyway I can get this association to work, eg:
item.Translations
Error message: Cannot create an association "Item_Translation". Properties do not have matching types: "TranslationId", "Id".
I know it has to do with TranslationId being nullable because another another table with an association to Translations works correctly, however its TranslationId column is NOT NULL.
Sample data from Translation:
Id Language Translation
1 en-us some text
1 en-gb some text
2 en-us some text
2 en-gb some text