开发者

How to access Link table (2 associations, 2 primary foreign key) In Entity Framework 4 database generated edmx file

I have 2 tables:

User (UserID, UserName)

Books (BookID, BookName)

Each user can hold many books, each book can be hold by many users.

so there is a link table:

UserBook (PFK UserID, PFK BookID).

I've generated a Model using EF4, and I can see the association in the Model, but I can't see User.UserBook,开发者_如何学C nor Book.UserBook. and no UserBook object as well.

how can I query this table ? add items ? etc... ?


User has Books collection, Books has User Collection, Missed that. Idea came through :

this article

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜