【发布时间】:2011-03-15 09:10:07
【问题描述】:
我在 DB 中有两个表:Foo 和 Bar
使用实体框架我想创建包含两个表都具有的属性的基本实体。
例如 Foo 有列 Id,CreateDate,FooValue 并且 Bar 有 Id,CreateDate,BarValue
- 所以 BaseEntity 应该有 Id 和 CreateDate 属性
- Foo 应该继承 BaseEntity 并具有 FooValue
- Bar 应该继承 BaseEntity 并具有 BarValue
如何将属性映射到它们在 DB 中的表?
【问题讨论】:
标签: entity-framework inheritance