views:

1030

answers:

1

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!

+6  A: 

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.

gcores

related questions