What's the difference between using IList
, IEnumerable
, ISet
or ICollection
for collections of child objects in NHibernate's entities classes? I.e:
public class Parent
{
public virtual int IdParent { set; get; }
public virtual IList<Child> Children { set; get; }
// Or
public virtual ISet<Child> Children { set; get; }
// Or so on...
}
IList
Bags
ISet
Iesi.Collections
)ICollection can be used as the type of the child collection which can be mapped by any of the three NHibernate Mappings
Nhibernate Cookbook 3.0 has a good explaination of using each of the collection , Just in case you happen to come across it.
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