How to use ObservableCollection with free nHibernate?

ObservableCollection<ItemPedido> Items

But now in Fluent nHibernate, I don’t know how to use it. Is there an easy way to use ObservableCollection with Fluent nHibernate? I noticed that there is a NHibernate.Collection.Observable DLL;

But I do not know how to replace my current code that uses IList:

    public virtual IList<ItemPedido> Items
    {
        get { return _Items; }
        set { _Items = value; OnPropertyChanged(System.Reflection.MethodBase.GetCurrentMethod().Name.Substring(4)); /*OnPropertyChanged("Items");*/ }
    } private IList<ItemPedido> _Items;

How to change the above code to work with the Observable Collection and Fluent nHibernate?

+3
source share
2 answers

Continue to use ObservableCollection<T>as implementation IList<T>- no need to change the business code.

All you have to do is configure NHibernate to IList<T>internally replace with NhibernateObservableCollection when doing lazy loading.

uNhAddIns.WPF.Collections.Types.ObservableListType<T>

from NHibernate Addins (unhaddins) .

, , NhibernateObservableCollection .

fluent-nibernate-with-wpf-convention-to-use-unhaddins-observablelisttypet-as-Default , ObservableCollection nHibernate.

, uNhAddIns.WPF.Collections.Types.ObservableListType<T>: , uNhAddIns.WPF.dll # sourcecode.

+3

All Articles