I am new to NHibernate. I use the <set ...> mapping for some many-to-one and many-to-many associations. They are shown as properties of type ICollection <T>; in practice, HashSet <T> are implemented.
My question is: should I override Equals and GetHashCode for related types so that they match the identifier of the type database (in practice, so that the objects are equal when the Id property is equal)? Or is NHibernate handling this for me somehow?
If I do this, I see a problem if I want to insert multiple values ββinto the many-to-many collection at any time, because new elements may have the identifier Guid.Empty; and therefore be considered the same subject.
source share