Can .NET 4 ISet<> HashSet<> replace NHibernate Iesi.Collections ISet , HashSet ? I am using Castle proxy, and NHibernate 3.0 .
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
Yes, with Nhibernate 4, using
System.Collections.Generic.ISet<>
is now the way to go.Yes. There are two approaches:
ICollection<T>
and initialize it asHashSet<T>
. See this article. I model collections as private members and exposeIEnumerable<T>
so this works well, but the downside is that you can't exposeISet<T>
.No, not as of this reply.
The NHibernate engine uses the
Iesi.Collections.ISet
interface on internal collection classes which are used as wrappers around collections in your classes which NHibernate persists. There is no direct conversion toSystem.Collections.Generic.ISet<T>
.Update: NHibernate 4 now uses
HashSet<T>
from the BCL internally, andHashedSet<T>
has been removed from theIesi.Collections
dependency. The approach to useSystem.Collections.Generic.ISet<T>
is now available.