因为我在我的数据库中支持软删除,所以我选择将我的Thing
实体子类型为ActiveThing
and DeletedThing
...
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
// TPH (table-per-hierarchy):
modelBuilder.Entity<MyCorp.Biz.CoolApp.Thing>()
.Map<MyCorp.Biz.CoolApp.ActiveThing>(thg => thg.Requires("Discriminator").HasValue("A"))
.Map<MyCorp.Biz.CoolApp.DeletedThing>(thg => thg.Requires("Discriminator").HasValue("D"));
}
现在,我的 OData 端点(以前暴露Thing
)..我如何让它现在只暴露ActiveThing
s?