Missing Association Links

I must have spent good one hour trying to figure out why when I do category and dot, the products collection does not appear. I confirmed in the designer that category and product has an association link but when I open up designer.cs, I don't see Products EntitySet defined in Category class. It's really confusing why the designer shows that there is an association between category and products but the code is not generated. After an hour I finally realized that my category table did not define categoryid as primary key column. So keep in mind that if your table does not have primary key column defined, linq to SQL designer would not generate the code for association relationship.

1 Comment

Comments have been disabled for this content.