Hibernate version: 2.0 GA
I am testing my custom collection, which inherits from PersistentGenericBag<T>. Initial tests worked fine until I enabled cascade="all-delete-orphan". Now my tests are failing with this message:
System.InvalidCastException: Unable to cast object of type 'Mc.Collections.Bag`1[Mc.NHibernate.Collections.Tests.Entities.OrderLine]' to type 'System.Collections.ICollection'.
I tried implementing ICollection on my bag but Resharper complains that it is redundant since I am inheriting from PersistentGenericBag<T> which implements IList, there by implementing ICollection. So how come it cannot cast it to ICollection. Does it have to do something with proxies maybe. I am lazy loading my collections.
|