【发布时间】:2017-04-05 11:18:10
【问题描述】:
我在代码优先模型中使用 TPH 方法,基类是 WItem 类型,派生是 BItem,我只想检索所有 WItems 行,所以我做了这个
return View(db.WItems.OfType<WItem>().ToList());
但我仍然得到所有行WHERE [Extent1].[Discriminator] IN (N'BItem',N'WItem')}?
【问题讨论】:
标签: c# entity-framework ef-code-first entity-framework-6 tph