Recently I have upgraded my NHibernate library with latest version 4.0.3.4000. After that - during compilation I faced an issue related to "Iesi.Collections.Generic.ISet". From details I understand that - this interface is dropped off and alternate options are available - one of it is LinkedHashSet.
I would like to know that - is this the best alternate to replace ISet?
This is from release notes:
** Known BREAKING CHANGES from NH3.3.3.GA to 4.0.0.GA
NHibernate now targets .Net 4.0. Many uses of set types from Iesi.Collections have now been changed to use corresponding types from the BCL. The API for these types are slightly different.
So we can now use interface
System.Collections.Generic.ISet<T>
and as its implementation even the System
built in types, e.g.
System.Collections.Generic.HashSet<T>
And therefore reduce dependency on iesi library...
But as discussed here: What is a suitable NHibernate / Iesi.Collections.Generic.ISet<T> replacement? - we can also use the LinkedHashSet<T>
, ReadOnlySet<T>
, SychronizedSet<T>
Also check the Customer.cs
in NHibernate test project:
using System.Collections.Generic;
using System.Collections.ObjectModel;
namespace NHibernate.DomainModel.Northwind.Entities
{
public class Customer
{
private readonly ISet<Order> _orders;
public Customer()
{
_orders = new System.Collections.Generic.HashSet<Order>();
}
public virtual ISet<Order> Orders
{
get { return _orders; }
}
...
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