Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IsDirty() flushes new Collection entities

I have a WPF application and am using NHibernate. My question is how do I manage change?

I am not completely sure about the behavior of the IsDirty.

This link describes my problem. The problem list all the information of current environment.

like image 201
C_sharp Avatar asked May 15 '13 20:05

C_sharp


1 Answers

You are trying to address a client side problem using server side technology. Create a viewmodel and put your data in an ObservableCollection and implement the INotifyPropertyChanged interface on the entities as described here

This way you separate the Dirty() logic from NHibernate and make it a "pure" WPF/client issue. In the link it is described in both answers how you can track additions and deletions to/from the collection as well as changes to the properties of the items.

When you are ready to persists your data you hand the dirty records to NHibernate.

like image 154
Tommy Grovnes Avatar answered Oct 20 '22 06:10

Tommy Grovnes