【问题标题】:How do I properly ignore my base objects?如何正确忽略我的基础对象?
【发布时间】: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 中?

谢谢, 斯蒂芬

【问题讨论】:

    标签: fluent-nhibernate


    【解决方案1】:

    在全球范围内,我发现无法通过创建模式来处理各种情况。现在我已经为独特的数据库设置创建了一个预处理程序。如果有人有任何想法,我愿意接受。

    【讨论】:

      猜你喜欢
      • 2018-09-25
      • 1970-01-01
      • 2013-06-11
      • 1970-01-01
      • 2012-09-04
      • 1970-01-01
      • 2018-01-02
      • 2017-02-24
      • 1970-01-01
      相关资源
      最近更新 更多