Can .NET 4 ISet<> HashSet<> replace NHibernate Iesi.Collections ISet , HashSet ? I am using Castle proxy, and NHibernate 3.0 .
Yes. There are two approaches:
ICollection
and initialize it as
HashSet
. See this article. I model collections as private
members and expose IEnumerable
so this works well, but the downside is that you can't expose ISet
.