public static EthnicOrigin CreateEthnicOrigin(string ethnicOriginId) { EthnicOrigin ethnicOrigin = new EthnicOrigin(); ethnicOrigin.EthnicOriginId = ethnicOriginId; return(ethnicOrigin); }
/// <summary> /// Returns true if PersonalInfo instances are equal /// </summary> /// <param name="other">Instance of PersonalInfo to be compared</param> /// <returns>Boolean</returns> public bool Equals(PersonalInfo other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( MaidenName == other.MaidenName || MaidenName != null && MaidenName.Equals(other.MaidenName) ) && ( MaritalStatus == other.MaritalStatus || MaritalStatus != null && MaritalStatus.Equals(other.MaritalStatus) ) && ( AdditionalID == other.AdditionalID || AdditionalID != null && AdditionalID.Equals(other.AdditionalID) ) && ( PlaceOfBirth == other.PlaceOfBirth || PlaceOfBirth != null && PlaceOfBirth.Equals(other.PlaceOfBirth) ) && ( Nationality == other.Nationality || Nationality != null && Nationality.Equals(other.Nationality) ) && ( EthnicOrigin == other.EthnicOrigin || EthnicOrigin != null && EthnicOrigin.Equals(other.EthnicOrigin) ) && ( VisaRequired == other.VisaRequired || VisaRequired != null && VisaRequired.Equals(other.VisaRequired) ) && ( DisabledNo == other.DisabledNo || DisabledNo != null && DisabledNo.Equals(other.DisabledNo) ) && ( Disability == other.Disability || Disability != null && Disability.Equals(other.Disability) )); }
/// <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 (MaidenName != null) { hashCode = hashCode * 59 + MaidenName.GetHashCode(); } if (MaritalStatus != null) { hashCode = hashCode * 59 + MaritalStatus.GetHashCode(); } if (AdditionalID != null) { hashCode = hashCode * 59 + AdditionalID.GetHashCode(); } if (PlaceOfBirth != null) { hashCode = hashCode * 59 + PlaceOfBirth.GetHashCode(); } if (Nationality != null) { hashCode = hashCode * 59 + Nationality.GetHashCode(); } if (EthnicOrigin != null) { hashCode = hashCode * 59 + EthnicOrigin.GetHashCode(); } if (VisaRequired != null) { hashCode = hashCode * 59 + VisaRequired.GetHashCode(); } if (DisabledNo != null) { hashCode = hashCode * 59 + DisabledNo.GetHashCode(); } if (Disability != null) { hashCode = hashCode * 59 + Disability.GetHashCode(); } return(hashCode); } }