我正在尝试将 EF 实体集添加到字典中,如以下代码所示:
private static readonly Dictionary<string, ObjectSet<EntityObject>> Gateways
= new Dictionary<string, ObjectSet<EntityObject>>
{
{"PlanSection", ModelEntities.PlanSection}
};
但编译器说:
cannot convert from 'System.Data.Objects.ObjectSet<MathApplication.Models.PlanSection>' to 'System.Data.Objects.ObjectSet<System.Data.Objects.DataClasses.EntityObject>'
PlanSection
是从数据库表映射的类。我的代码有什么问题?
编辑
这是PlanSection
定义:
public partial class PlanSection : EntityObject