There is probably a very simple solution for this but my Google Foo fails me :(
I got a plain old object with auto-properties. What I want to do is to change some flag on the property if any of the properties is changed. This can obviously done by messing with all the setters like so ...
private bool _changed;
private string _foo;
public string Foo
{
get => _foo;
set { _foo = value; _changed = true; }
}
But for obvious reasons this is both cumbersome and error prone (these objects have tens of properties). So is there some way to do this generically?
Cheers!