我试图首先使用代码在Entity Framework中映射多个到多个SQL关系 .

这是我的课程:

[表(“B3_360ViewerData”)]公共类ViewerData:实体
{
// ....其他属性...... //

//导航属性
public EntityCollection <Feature> Features {get;组; }
} [表(“B3_Feature”)]公共类特征:实体{// ....其他属性... //
//导航属性
public ICollection <ViewerData> ViewerData {get;组; }
} CREATE TABLE [dbo] . [ViewerDataFeatures]([Feature_Id] [int] NULL,[ViewerData_Id] [int] NULL)

这个表中的插入很顺利,但是当我想要检索ViewerData实体时,我没有填充Features集合,它是null .

我错过了什么吗?