开发者

Visual Studio is not creating field in code of association added in linq-to-sql in designer

开发者 https://www.devze.com 2023-02-01 14:05 出处:网络
I added an association in the Linq-to-sql designer, but Visual Studio did not generated the code necessary for the field.

I added an association in the Linq-to-sql designer, but Visual Studio did not generated the code necessary for the field.

I have RequestFormView and a ItemRequestView in the designer. I added the parent-child association m开发者_运维问答anually in the designer by doing "Add Association". The association looks good in the designer, however the RequestFormView class (in code) does not have the "ItemRequestsViews" that I specified in the "Child Property" setting.

Any suggestions?

Thank you!


All I needed to do was to set the Primary Keys in the Linq-to-sql designer for RequestFormView and ItemRequestView because the entities I was working on were based on SQL views.


I have the same problem. here's my question. https://stackoverflow.com/questions/6838295/why-assocaites-didnt-get-generated-in-dbml-file

I have 3 tables.

Posts: PostID, PostName

Tags: TagID, TagName

PostTag: PostID, TagID (this one didn't have PK, only 2 FKs)

in the linq to sql designer, I set PK for "Posts" and "Tags". "PostTag" didnt have PK, so I didnt set it. I just coudln't get association generated in my dbml file.

0

精彩评论

暂无评论...
验证码 换一张
取 消