Tag: iesi collections

什么是合适的NHibernate / Iesi.Collections.Generic.ISet 替换?

在最新版本的Iesi.Collections中缺少Iesi.Collections.Generic.ISet。 似乎有三种选择: LinkedHashSet ReadOnlySet SynchronizedSet Iesi.Collections.Generic.ReadOnlySet似乎最接近ISet,文档说明: … although it’s advertised as immutable it really isn’t. Anyone with access to the wrapped set can still change the set. 似乎ReadOnlySet是ISet的最佳替代品? 目前,实现是通过公共方法向集合添加项目,因此它似乎是最合适的。 替代方案(IList,bag?)似乎需要更多资源或不那么快/有效)? 还有更好的选择吗? (该列表不应该有重复,可以手动validation) 我会做的事情如下: public virtual ISet MyClass { get { return this.myClass } } public virtual void AddItem(MyClass item) { … // Null checks and […]