Skip to content

Instantly share code, notes, and snippets.

@mikebranstein
Last active August 29, 2015 14:05
Show Gist options
  • Save mikebranstein/5b5f6613074334255705 to your computer and use it in GitHub Desktop.
Save mikebranstein/5b5f6613074334255705 to your computer and use it in GitHub Desktop.
Person Rich Object Domain
class Person {
public string FirstName { get; private set; }
public string LastName { get; private set; }
public Person(string firstName, string lastName) {
ChangeName(firstName, lastName);
}
public void ChangeName(string firstName, string lastName) {
if (firstName == null) throw new ArgumentException("firstName cannot be null");
if (lastName == null) throw new ArgumentException("lastName cannot be null");
FirstName = firstName;
LastName = lastName;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment