I have a DTO class, and in my WinForms client I'm creating a datasource for it. In form design, I bind the bindingsource to this datasource so that all controls will be bound automatically.
In code I do the following to bind the bindingsource to an empty object:
public void Clear()
{
var dto = new MyDTO();
bindingSource.DataSource = dto;
}
To get an item from the db and display it is similar:
public void Load(int id)
{
var dto = dtoRequest.Get(id);
bindingSource.DataSource = dto;
}
However I want to know if data has changed after the datasource has been set. Do I need to implement INotifyPropertyChanged in my DTO classes? Because if this is the case, it would defeat the purpose of having DTO's in the first place.
Are there any other solutions?