Beispiel #1
0
 public static Person Create(PersonName name, OfficeLocation officeLocation, EmailAddress emailAddress)
 {
     return(new Person(
                name ?? throw new ArgumentNullException(nameof(name)),
                officeLocation ?? throw new ArgumentNullException(nameof(officeLocation)),
                emailAddress ?? throw new ArgumentNullException(nameof(emailAddress))));
 }
Beispiel #2
0
 protected override int GetHashCodeCore()
 {
     unchecked
     {
         var hashCode = Name.GetHashCode();
         hashCode = (hashCode * 397) ^ OfficeLocation.GetHashCode();
         hashCode = (hashCode * 397) ^ EmailAddress.GetHashCode();
         return(hashCode);
     }
 }
Beispiel #3
0
 internal void UpdateAwardWinnerOfficeLocation(OfficeLocation newOfficeLocation)
 {
     Person = Person.UpdateOfficeLocation(newOfficeLocation);
 }
Beispiel #4
0
 private Person(PersonName name, OfficeLocation officeLocation, EmailAddress emailAddress)
 {
     Name           = name;
     OfficeLocation = officeLocation;
     EmailAddress   = emailAddress;
 }
Beispiel #5
0
 public Person UpdateOfficeLocation(OfficeLocation newOfficeLocation)
 {
     return(Create(Name, newOfficeLocation, EmailAddress));
 }