2011/3/19 cidico <[email protected]> > Hello, > > I was reading a post about the uses of bags and sets and the author > recommended "always use the <set> in your mapping file" and he says > that <set> has a lot better performance gain the using the <bag>. > > My question is: Is there any problem to use the HashedSet<T> with the > interface ICollection<T> (native from .NET)?
* You can store a HashedSet in a ICollection<T> field, and publish your field as ICollection or even IEnumerable. * Or you can store your HashedSet in a ICollection<T> property. * Alternatively you can pull this single file from nuget and use HashSet (of .net 4): http://nhforge.org/blogs/nhibernate/archive/2011/03/15/using-lt-set-gt-in-mappings-without-iesi-collections-net-4.aspx > And why <set> is the best > option ? > This is very well explained here: http://www.nhforge.org/doc/nh/en/index.html#performance-collections -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
