コード例 #1
0
ファイル: Person.cs プロジェクト: memerson/StarFisher
 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))));
 }
コード例 #2
0
ファイル: Person.cs プロジェクト: memerson/StarFisher
 protected override int GetHashCodeCore()
 {
     unchecked
     {
         var hashCode = Name.GetHashCode();
         hashCode = (hashCode * 397) ^ OfficeLocation.GetHashCode();
         hashCode = (hashCode * 397) ^ EmailAddress.GetHashCode();
         return(hashCode);
     }
 }
コード例 #3
0
ファイル: AwardWinner.cs プロジェクト: memerson/StarFisher
 internal void UpdateAwardWinnerOfficeLocation(OfficeLocation newOfficeLocation)
 {
     Person = Person.UpdateOfficeLocation(newOfficeLocation);
 }
コード例 #4
0
ファイル: Person.cs プロジェクト: memerson/StarFisher
 private Person(PersonName name, OfficeLocation officeLocation, EmailAddress emailAddress)
 {
     Name           = name;
     OfficeLocation = officeLocation;
     EmailAddress   = emailAddress;
 }
コード例 #5
0
ファイル: Person.cs プロジェクト: memerson/StarFisher
 public Person UpdateOfficeLocation(OfficeLocation newOfficeLocation)
 {
     return(Create(Name, newOfficeLocation, EmailAddress));
 }