/// <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 (SurnamePrefix != null) { hashCode = hashCode * 59 + SurnamePrefix.GetHashCode(); } if (Title != null) { hashCode = hashCode * 59 + Title.GetHashCode(); } return(hashCode); } }
public override int GetHashCode() { unchecked { var result = FirstName?.GetHashCode() ?? 0; result = (result * 397) ^ (SurnamePrefix?.GetHashCode() ?? 0); result = (result * 397) ^ (Surname?.GetHashCode() ?? 0); return(result); } }
/// <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 (AdditionalAddressInfo != null) { hashCode = hashCode * 59 + AdditionalAddressInfo.GetHashCode(); } if (City != null) { hashCode = hashCode * 59 + City.GetHashCode(); } if (CountryCode != null) { hashCode = hashCode * 59 + CountryCode.GetHashCode(); } if (FirstName != null) { hashCode = hashCode * 59 + FirstName.GetHashCode(); } if (HouseNumber != null) { hashCode = hashCode * 59 + HouseNumber.GetHashCode(); } if (State != null) { hashCode = hashCode * 59 + State.GetHashCode(); } if (StateCode != null) { hashCode = hashCode * 59 + StateCode.GetHashCode(); } if (Street != null) { hashCode = hashCode * 59 + Street.GetHashCode(); } if (Surname != null) { hashCode = hashCode * 59 + Surname.GetHashCode(); } if (SurnamePrefix != null) { hashCode = hashCode * 59 + SurnamePrefix.GetHashCode(); } if (Zip != null) { hashCode = hashCode * 59 + Zip.GetHashCode(); } return(hashCode); } }