【发布时间】:2016-03-08 03:57:17
【问题描述】:
如何通过 EF 读取多对多表?我不知道如何使用多对多表。假设Product_Category 得到ProductID 和CategoryID。
我如何通过例如访问它
using(Entities db = new Entities)
{
/* cant access these here.. */}
方法??但是我可以联系到Product_Category,但无法访问它的ProductID 或CategoryID。
我想列出每个产品,例如Product_Category.CategoryID == Category.ID.
我以前从未使用过多对多表,因此我很欣赏一些简单的示例,如何通过 asp.net 中的 EF 访问它们。
谢谢
【问题讨论】:
标签: c# sql asp.net entity-framework many-to-many