one-to-one fluent nhibernate?

↘锁芯ラ 提交于 2019-12-06 03:33:38

问题


Is it possible yet to do a one-to-one mapping with fluent nhibernate? I have the following as part of an hbm that I'm trying to convert to fluent:

    <one-to-one name="Person" property-ref="FileData" constrained="true"/>

I see a OneToOnePart<OTHER> in the code but i'm not sure how or if this is used to accomplish this.

Thanks!


回答1:


There is a HasOne mapping

map => map.HasOne(x => x.Person)
     .PropertyRef(x => x.FileData)
     .Constrained();

I think that's what you're looking for.



来源:https://stackoverflow.com/questions/579414/one-to-one-fluent-nhibernate

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!