【发布时间】:2015-09-18 14:31:26
【问题描述】:
据此话题Fluent nHibernate with Automapping: How to get a parent or "containg" object from a child
我已经使用“父”属性创建了类:
class Box
{
public virtual int Id { get; protected set;}
public virtual IList<Item> Items {get; protected set;}
}
class Item
{
public virtual int Id { get; protected set;}
public virtual Box Parent {get; set;}
}
正如上述主题中所建议的,我编写了将Parent 属性的键列设置为与Box 中Items 的键列相同的约定。
不同之处在于我想在Parent 属性上设置Inverse,而不是在收集端。有没有可能做到这一点?
我尝试编写IReferenceConvention 的正确实现,但我看不到这种可能性。
【问题讨论】:
标签: c# nhibernate fluent-nhibernate automapping