【发布时间】:2011-10-02 06:07:21
【问题描述】:
每次我尝试允许 Fluent NHibernate 自动映射我的域模型时,我 得到以下错误...
实体“BaseObject”没有映射 Id。使用 ID 方法 映射您的身份属性。例如:Id(x => x.Id)。
我的领域模型看起来像这样......
Customer (Assembly #1)
CoreEntity (Assembly #1)
EntityWithTypeId<Guid> (Assembly #2)
BaseObject (Assembly #2)
我发现的唯一解决方法是调用以下内容..
.IgnoreBase<BaseObject>()
.IgnoreBase<CoreEntity>()
有没有比使用 IgnoreBase 更好的方法?也许在一个公约或 在 DefaultAutomappingConfiguration 中?
谢谢, 斯蒂芬
【问题讨论】: