What are the differences between HasOne()
and References()
in nhibernate?
HasOne
creates a one-to-one mapping between tables for you. References
creates a typical relational many-to-one relationship.
More defined:
Note: where I say table you can replace that safely with class or entity as you wish, when using FluentNH it's easy to use them interchangeably.
This is more precisely explained in this fluentnhibernate wiki article.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With