C# getter and setter shorthand
If my understanding of the internal workings of this line is correct: public int MyInt { get; set; } Then it behind the scenes does this: private int _MyInt { get; set; } Public int MyInt { get{return _MyInt;} set{_MyInt = value;} } What I really need is: private bool IsDirty { get; set; } private int _MyInt { get; set; } Public int MyInt { get{return _MyInt;} set{_MyInt = value; IsDirty = true;} } But I would like to write it something like: private bool IsDirty { get; set; } public int MyInt { get; set{this = value; IsDirty = true;} } Which does not work. The thing is some of the objects I