public override int GetHashCode() { var hashCode = -1139607398; hashCode = hashCode * -1521134295 + Id.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Title); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(FirstName); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(LastName); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(UserName); hashCode = hashCode * -1521134295 + DateOfBirth.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer <Address> .Default.GetHashCode(Address); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Email); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(PhoneNumber); hashCode = hashCode * -1521134295 + DateCreated.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(PasswordHash); return(hashCode); }
public override int GetHashCode() { int result = 1; result = (result * 397) ^ (AltEmailAddress != null ? AltEmailAddress.GetHashCode() : 0); result = (result * 397) ^ (AltTelephoneContact != null ? AltTelephoneContact.GetHashCode() : 0); result = (result * 397) ^ (CreatedOn != null ? CreatedOn.GetHashCode() : 0); result = (result * 397) ^ (DateOfBirth != null ? DateOfBirth.GetHashCode() : 0); result = (result * 397) ^ (EmailAddress != null ? EmailAddress.GetHashCode() : 0); result = (result * 397) ^ (Gender != null ? Gender.GetHashCode() : 0); result = (result * 397) ^ (GivenName != null ? GivenName.GetHashCode() : 0); result = (result * 397) ^ (HomeLanguage != null ? HomeLanguage.GetHashCode() : 0); result = (result * 397) ^ Id.GetHashCode(); result = (result * 397) ^ (LastModified != null ? LastModified.GetHashCode() : 0); result = (result * 397) ^ (MaritalStatus != null ? MaritalStatus.GetHashCode() : 0); result = (result * 397) ^ (NextOfKinAddress != null ? NextOfKinAddress.GetHashCode() : 0); result = (result * 397) ^ (NextOfKinContact != null ? NextOfKinContact.GetHashCode() : 0); result = (result * 397) ^ (NextOfKinName != null ? NextOfKinName.GetHashCode() : 0); result = (result * 397) ^ (NextOfKinRelationship != null ? NextOfKinRelationship.GetHashCode() : 0); result = (result * 397) ^ (Occupation != null ? Occupation.GetHashCode() : 0); result = (result * 397) ^ (Organisation != null ? Organisation.GetHashCode() : 0); result = (result * 397) ^ (OtherName != null ? OtherName.GetHashCode() : 0); result = (result * 397) ^ (PermentAddress != null ? PermentAddress.GetHashCode() : 0); result = (result * 397) ^ (PersonOwnerType != null ? PersonOwnerType.GetHashCode() : 0); result = (result * 397) ^ (PlaceOfBirth != null ? PlaceOfBirth.GetHashCode() : 0); result = (result * 397) ^ (PostalAddress != null ? PostalAddress.GetHashCode() : 0); result = (result * 397) ^ (PreferredLanguage != null ? PreferredLanguage.GetHashCode() : 0); result = (result * 397) ^ (ProfilePhotoName != null ? ProfilePhotoName.GetHashCode() : 0); result = (result * 397) ^ (Religion != null ? Religion.GetHashCode() : 0); result = (result * 397) ^ (Surname != null ? Surname.GetHashCode() : 0); result = (result * 397) ^ (TelephoneContact != null ? TelephoneContact.GetHashCode() : 0); result = (result * 397) ^ (Title != null ? Title.GetHashCode() : 0); result = (result * 397) ^ (WebsiteUrl != null ? WebsiteUrl.GetHashCode() : 0); return(result); }
public override int GetHashCode() { var hashCode = -296157271; hashCode = hashCode * -1521134295 + EqualityComparer <Image> .Default.GetHashCode(SoldirAvatar); hashCode = hashCode * -1521134295 + ID.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Name); hashCode = hashCode * -1521134295 + EqualityComparer <Rank> .Default.GetHashCode(Rank); hashCode = hashCode * -1521134295 + EqualityComparer <Role> .Default.GetHashCode(Role); hashCode = hashCode * -1521134295 + EqualityComparer <Profession> .Default.GetHashCode(MainProfession); hashCode = hashCode * -1521134295 + EqualityComparer <Profession> .Default.GetHashCode(SecondaryProfession); hashCode = hashCode * -1521134295 + EqualityComparer <ArmoredVessels> .Default.GetHashCode(CombatInlay); hashCode = hashCode * -1521134295 + EqualityComparer <Subunit> .Default.GetHashCode(Subunit); hashCode = hashCode * -1521134295 + DateOfBirth.GetHashCode(); hashCode = hashCode * -1521134295 + Age.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Address); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(MobileNumber); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(HomeNumber); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Email); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Notes); return(hashCode); }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (FirstName != null) { hashCode = hashCode * 59 + FirstName.GetHashCode(); } if (LastName != null) { hashCode = hashCode * 59 + LastName.GetHashCode(); } if (DateOfBirth != null) { hashCode = hashCode * 59 + DateOfBirth.GetHashCode(); } if (PlaceOfBirth != null) { hashCode = hashCode * 59 + PlaceOfBirth.GetHashCode(); } if (NationalIdNumber != null) { hashCode = hashCode * 59 + NationalIdNumber.GetHashCode(); } if (NationalIdType != null) { hashCode = hashCode * 59 + NationalIdType.GetHashCode(); } return(hashCode); } }
public override int GetHashCode() { //bad yet simple override hashcode method var hashCode = ID > 8989892342 + DateOfBirth.GetHashCode() + Name.GetHashCode() + Country.GetHashCode(); return(hashCode.GetHashCode()); }
public override int GetHashCode() { unchecked { int result = (Name != null ? Name.GetHashCode() : 0); result = (result * 397) ^ (PhoneNumbers != null ? PhoneNumbers.GetHashCode() : 0); result = (result * 397) ^ DateOfBirth.GetHashCode(); result = (result * 397) ^ (Email != null ? Email.GetHashCode() : 0); return(result); } }
public override int GetHashCode() { int result = Surname.GetHashCode(); result = 13 * result + Name.GetHashCode(); result = 23 * result + DateOfBirth.GetHashCode(); result = 17 * result + DateOfEnrollment.GetHashCode(); result = 31 * result + getEducation().GetHashCode(); result = 23 * result + getDesireToServe().GetHashCode(); return(result); }
public override int GetHashCode() { unchecked { var hashCode = Id.GetHashCode(); hashCode = (hashCode * 397) ^ (Firstname != null ? Firstname.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Lastname != null ? Lastname.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Age; hashCode = (hashCode * 397) ^ DateOfBirth.GetHashCode(); hashCode = (hashCode * 397) ^ IsPressent.GetHashCode(); return(hashCode); } }
public override int GetHashCode() { int hash = 1; if (Surname.Length != 0) { hash ^= Surname.GetHashCode(); } if (Forename.Length != 0) { hash ^= Forename.GetHashCode(); } hash ^= otherNames_.GetHashCode(); if (Salutation.Length != 0) { hash ^= Salutation.GetHashCode(); } if (Suffix.Length != 0) { hash ^= Suffix.GetHashCode(); } if (DisplayName.Length != 0) { hash ^= DisplayName.GetHashCode(); } if (Gender != global::PKIo.Gender.NotKnown) { hash ^= Gender.GetHashCode(); } if (dateOfBirth_ != null) { hash ^= DateOfBirth.GetHashCode(); } if (EmailAddress.Length != 0) { hash ^= EmailAddress.GetHashCode(); } if (MobileNumber.Length != 0) { hash ^= MobileNumber.GetHashCode(); } if (ExternalId.Length != 0) { hash ^= ExternalId.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
public void Test_DateOfBirth_To_DateTimeCasting() { // Arrange DateOfBirth dateOfBirth = new DateOfBirth(new DateTime(2019, 1, 1)); // Act DateTime date = dateOfBirth; // Assert Assert.Equal(dateOfBirth, date, new TimeSpan(1, 0, 0, 0)); Assert.Equal(dateOfBirth.GetHashCode(), date.GetHashCode()); Assert.Equal(dateOfBirth.ToString(), date.ToString("yyyy-MM-dd")); Assert.True(dateOfBirth.Equals(date)); }
public override int GetHashCode() { unchecked { var hashCode = Id; hashCode = (hashCode * 397) ^ (UserName != null ? UserName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (FirstName != null ? FirstName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (LastName != null ? LastName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (PhoneNumber != null ? PhoneNumber.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (DateOfBirth != null ? DateOfBirth.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (CallNoteName != null ? CallNoteName.GetHashCode() : 0); return(hashCode); } }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (StaffNumber != null) { hashCode = hashCode * 59 + StaffNumber.GetHashCode(); } if (Title != null) { hashCode = hashCode * 59 + Title.GetHashCode(); } if (Forenames != null) { hashCode = hashCode * 59 + Forenames.GetHashCode(); } if (Surname != null) { hashCode = hashCode * 59 + Surname.GetHashCode(); } if (MiddleInitials != null) { hashCode = hashCode * 59 + MiddleInitials.GetHashCode(); } if (KnownAs != null) { hashCode = hashCode * 59 + KnownAs.GetHashCode(); } hashCode = hashCode * 59 + Gender.GetHashCode(); if (DateOfBirth != null) { hashCode = hashCode * 59 + DateOfBirth.GetHashCode(); } if (Ssn != null) { hashCode = hashCode * 59 + Ssn.GetHashCode(); } return(hashCode); } }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (FirstName != null) { hashCode = hashCode * 59 + FirstName.GetHashCode(); } if (Surname != null) { hashCode = hashCode * 59 + Surname.GetHashCode(); } if (DateOfBirth != null) { hashCode = hashCode * 59 + DateOfBirth.GetHashCode(); } hashCode = hashCode * 59 + PersonGender.GetHashCode(); if (MatchId != null) { hashCode = hashCode * 59 + MatchId.GetHashCode(); } if (AllocatePersonId != null) { hashCode = hashCode * 59 + AllocatePersonId.GetHashCode(); } if (Email != null) { hashCode = hashCode * 59 + Email.GetHashCode(); } if (TelephoneNumber != null) { hashCode = hashCode * 59 + TelephoneNumber.GetHashCode(); } if (ExtSystemId != null) { hashCode = hashCode * 59 + ExtSystemId.GetHashCode(); } return(hashCode); } }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (DateOfBirth != null) { hashCode = hashCode * 59 + DateOfBirth.GetHashCode(); } if (Gender != null) { hashCode = hashCode * 59 + Gender.GetHashCode(); } if (Name != null) { hashCode = hashCode * 59 + Name.GetHashCode(); } return(hashCode); } }
public override int GetHashCode() { int hash = 1; if (Name.Length != 0) { hash ^= Name.GetHashCode(); } if (Id != 0) { hash ^= Id.GetHashCode(); } if (Email.Length != 0) { hash ^= Email.GetHashCode(); } if (DateOfBirth.Length != 0) { hash ^= DateOfBirth.GetHashCode(); } hash ^= phones_.GetHashCode(); return(hash); }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (EmployeeId != null) { hashCode = hashCode * 59 + EmployeeId.GetHashCode(); } if (EmployeeCode != null) { hashCode = hashCode * 59 + EmployeeCode.GetHashCode(); } if (EmployeeName != null) { hashCode = hashCode * 59 + EmployeeName.GetHashCode(); } hashCode = hashCode * 59 + Gender.GetHashCode(); if (DateOfBirth != null) { hashCode = hashCode * 59 + DateOfBirth.GetHashCode(); } if (PhoneNumber != null) { hashCode = hashCode * 59 + PhoneNumber.GetHashCode(); } if (DepartmentId != null) { hashCode = hashCode * 59 + DepartmentId.GetHashCode(); } if (DepartmentName != null) { hashCode = hashCode * 59 + DepartmentName.GetHashCode(); } if (Email != null) { hashCode = hashCode * 59 + Email.GetHashCode(); } hashCode = hashCode * 59 + Salary.GetHashCode(); hashCode = hashCode * 59 + WorkStatus.GetHashCode(); if (PositionId != null) { hashCode = hashCode * 59 + PositionId.GetHashCode(); } if (PositionName != null) { hashCode = hashCode * 59 + PositionName.GetHashCode(); } if (TaxCode != null) { hashCode = hashCode * 59 + TaxCode.GetHashCode(); } if (JoinDate != null) { hashCode = hashCode * 59 + JoinDate.GetHashCode(); } if (IdentityNumber != null) { hashCode = hashCode * 59 + IdentityNumber.GetHashCode(); } if (IdentityDate != null) { hashCode = hashCode * 59 + IdentityDate.GetHashCode(); } if (IdentityPlace != null) { hashCode = hashCode * 59 + IdentityPlace.GetHashCode(); } return(hashCode); } }
public override int GetHashCode() { return(FirstName.GetHashCode() ^ LastName.GetHashCode() ^ DateOfBirth.GetHashCode() ^ Id.GetHashCode()); }
public override int GetHashCode() { // Для .Net Core // return HashCode.Combine(MyName, IdPass, DateOfBirth, City); return(MyName.GetHashCode() ^ IdPass ^ DateOfBirth.GetHashCode() ^ City.GetHashCode()); }
//public override int GetHashCode() //как бы перегружаем метод GetHashCode() public int GetHashCode1() { return(SurnameName.GetHashCode() + DateOfBirth.GetHashCode() + PlaceOfBirth.GetHashCode() + Passport.GetHashCode()); }
/// <summary> /// Get a hash code for the current object. /// </summary> /// <returns>A hash code for the current object.</returns> public override int GetHashCode() { return(FirstName.GetHashCode() * 5 + LastName.GetHashCode() + DateOfBirth.GetHashCode()); }