Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linq to SQL .DBML Child Property Problem

I have a 1:1 relationship between table 'A' and 'B' in my .DBML. The FK in the database is in place and the .DBML diagram shows an association line between 'A' and 'B'. However, I cannot get the code generator to create a child property in the 'A' entity. All I have is the FK column. In the Association properties, I have ChildProperty set to true. However, the code generator will not create the child property. I have dropped and added the two tables several times.

Anyone have any ideas?

like image 342
Randy Minder Avatar asked Mar 14 '11 14:03

Randy Minder


1 Answers

The O/R designer will refuse to create an association property if a primary key is missing on one of the associated tables. Make sure all of your associated tables have a primary key.

like image 62
shaunmartin Avatar answered Sep 21 '22 03:09

shaunmartin