IsDirty () cleans up new collection objects

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

I am not entirely sure about the behavior of IsDirty.

This link describes my problem. The problem lists all the information about the current environment.

+6
source share
1 answer

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

This way you separate the Dirty () logic from NHibernate and make it a "clean" WPF / client problem. The link in both answers describes how you can track additions and deletions to / from the collection, as well as changes to the properties of elements.

When you are ready to save your data, you transfer the dirty records to NHibernate.

+4
source

Source: https://habr.com/ru/post/945101/


All Articles