Trail:

Ticket #9 (new defect)

Opened 4 years ago

Last modified 4 years ago

NHibernate.DataBinding.BindingList<T> couldn't sort on ActiveRecord using Nhibernate 1.2

Reported by: Pieter-Jan Lammertyn <PJLammertyn@hhr.be> Assigned to: harald
Priority: blocker Milestone: Version 0.4.1
Component: NHibernate.DataBinding Version: latest
Keywords: Cc:

Description

NHibernate returns a PersistentGenericBag<T> witch doesn't inherit from List<T>. So the ConvertToList delegate in the BindingList<T> constructor won't work for 'return items as List<T>;' because items do not inherit from List<T>.

I solved it by modifying the Initialize function.

Error: Failed to load processor cs
No macro or processor named 'cs' found

Attachments

Change History

09/02/07 16:53:51 changed by harald

None of the NHibernate collection types inherits from List<T>, only from IList<T>. Your proposed bugfix defeats the whole point of having a wrapper instance. If you create a new List<T> instance a lazy NHibernate collection will be initialized and as this happens during the initialization of the BindigList<T> there won't be any lazy collection functionality anymore.

I'll try to figure out if I can easily reimplement Sort() only relying on IList<T>.


Add/Change #9 (NHibernate.DataBinding.BindingList<T> couldn't sort on ActiveRecord using Nhibernate 1.2)