Just wondering if it's possible to call a method using property attribute. Basically, I want to set state of the entity when any of the public property changes.
Like we have following code
public class Contact : EntityBase
{
[NotifyChange]
public string FirstName { get; set; }
private void ChangeState()
{
EntityState = EntityState.Modified;
}
}
And when we call
var c = new Contact();
c.FirstName = "John";
before (or after) setting value of FirstName, it call EntityState() function.
Any idea?