开发者

How to store one entity class in another in specific relation between tables?

I have these relations in my data base:

How to store one entity class in another in specific relation between tables?

I need all authors related to my 开发者_如何学Pythonbook stored in book entity class? I was trying to resolve this by using entityset but I can't use it because there is no primary key in BookAuthors table!

Any kind of help will be great! =)


LINQ-to-SQL requires a primary key in order for it to materialize entities. And since neither Books nor Authors entities know anything about each other, I think your only option is to add a PK to BookAuthors as Pleun mentioned.

This question is very similar to yours, but note the PK on the Order_Detail table: Problem with Linq2Sql Many-to-Many relationship & Inserting new objects.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜