我正在将 LINQ to SQL 转换为 EntityFramework 5。在 LINQ to SQL 中,我使用了此函数,仅按其类型(VB-Code)获取表:
Dim type As Type = myObject.GetType()
Dim context As MyEntities = New MyEntities()
query = context.GetTable(type).AsQueryable()
现在我正在 EF5 中寻找一种相等的方法。我在 SO 上找到了这个答案,但我的上下文没有一个名为CreateObjectSet
. 这是因为 EF4 和 EF5 之间的差异,还是我遗漏了什么?