public override int GetHashCode() { if (!string.IsNullOrEmpty(UserPrincipalName)) { return(UserPrincipalName.GetHashCode()); } else if (!string.IsNullOrEmpty(Mail)) { return(Mail.GetHashCode()); } return(base.GetHashCode()); }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Returns HashCode</returns> public override int GetHashCode() { return(String.Format("{0}|{1}|{2}|{3}|{4}|{5}|{6}|{7}|", PasswordProfile.GetHashCode(), AccountEnabled.GetHashCode(), DisplayName?.GetHashCode() ?? 0, MailNickname?.GetHashCode() ?? 0, PasswordPolicies?.GetHashCode() ?? 0, UserPrincipalName?.GetHashCode() ?? 0, ProfilePhoto?.GetHashCode() ?? 0, Licenses.Aggregate(0, (acc, next) => acc += (next != null ? next.GetHashCode() : 0)) ).GetHashCode()); }
public override int GetHashCode() { unchecked { var hashCode = (_userId != null ? _userId.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (EmailAddress != null ? EmailAddress.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Description != null ? Description.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (DisplayName != null ? DisplayName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Enabled.GetHashCode(); hashCode = (hashCode * 397) ^ (GivenName != null ? GivenName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Surname != null ? Surname.GetHashCode() : 0); hashCode = (hashCode * 397) ^ UserCannotChangePassword.GetHashCode(); hashCode = (hashCode * 397) ^ (UserPrincipalName != null ? UserPrincipalName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (VoiceTelephoneNumber != null ? VoiceTelephoneNumber.GetHashCode() : 0); return(hashCode); } }