The XML
mapping is more explicit in this way and usually maps IList<> to <bag>
and ISet
to <set>
. There is an explanation, how the Fluent engine (from version 1.2) tries to do the same:
https://github.com/jagregory/fluent-nhibernate/wiki/Fluent-mapping
(see section HasMany / one-to-many / Collection Types)
An extract from the link above:
public IList<Child> Children { get; set; }
HasMany(x => x.Children); // <bag />
private ISet<Child> _children;
public IEnumerable<Child> Children
{
get { return _children; }
}
HasMany(x => x.Children); // <set access="nosetter.camelcase-underscore" />
private ISet<Child> _children;
public IEnumerable<Child> GetChildren()
{
return _children;
}
HasMany(x => x.GetChildren()); // <set name="_children" access="field" />
So I would guess, that your "small differencies" in mapping could be hidden there