Search code examples
nhibernateormfluent-nhibernatemapping

Fluent NHibernate: mapping one-to-one


NHibernate seems to support a special case of one to one mapping (That doesn't require a 1-m mapping on each side of the relationship).

See this article by Ayende:

http://nhibernate.info/blog/2009/04/18/nhibernate-mapping-lt-one-to-one-gt.html

I have no idea how to specify this in Fluent NHibernate though - is this possible?


Solution

  • Ah, just found from a helpful person in the Fluent group that I can use

    HasOne(x => x.Cover);
    

    Missed it somehow before :/