Skip to content

Instantly share code, notes, and snippets.

@bsommardahl
Created August 18, 2012 15:43
Show Gist options
  • Save bsommardahl/3387814 to your computer and use it in GitHub Desktop.
Save bsommardahl/3387814 to your computer and use it in GitHub Desktop.
Auto-updating Entity
public class CustomerAddress
{
public event DomainEvent NotifyObservers;
string _name;
public string Name
{
get { return _name; }
set
{
_name = value;
NotifyObservers(new CustomerAddressChanged(this));
}
}
public string Address { get; set; }
public string City { get; set; }
public string State { get; set; }
public string Zip { get; set; }
}
public class CustomerAddressChanged
{
public readonly CustomerAddress CustomerAddress;
public CustomerAddressChanged(CustomerAddress customerAddress)
{
CustomerAddress = customerAddress;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment