Created
August 18, 2012 15:43
-
-
Save bsommardahl/3387814 to your computer and use it in GitHub Desktop.
Auto-updating Entity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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