问题
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