/// <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 (Class != null) { hashCode = hashCode * 59 + Class.GetHashCode(); } if (Links != null) { hashCode = hashCode * 59 + Links.GetHashCode(); } if (CredentialId != null) { hashCode = hashCode * 59 + CredentialId.GetHashCode(); } if (Id != null) { hashCode = hashCode * 59 + Id.GetHashCode(); } if (Uri != null) { hashCode = hashCode * 59 + Uri.GetHashCode(); } return(hashCode); } }
public override Dictionary <string, object> GetPrimitives() { return(new Dictionary <string, object> { { "CredentialId", CredentialId.ToString() }, { "Username", Username }, { "Password", EncryptedPassword }, { "Email", Email }, { "IsActive", IsActive } }); }
/// <summary> /// Returns true if GithubScm instances are equal /// </summary> /// <param name="other">Instance of GithubScm to be compared</param> /// <returns>Boolean</returns> public bool Equals(GithubScm other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Class == other.Class || Class != null && Class.Equals(other.Class) ) && ( Links == other.Links || Links != null && Links.Equals(other.Links) ) && ( CredentialId == other.CredentialId || CredentialId != null && CredentialId.Equals(other.CredentialId) ) && ( Id == other.Id || Id != null && Id.Equals(other.Id) ) && ( Uri == other.Uri || Uri != null && Uri.Equals(other.Uri) )); }
/// <summary> /// Determines whether the specified Object is equal to the current Object. /// </summary> /// <param name="obj"></param> /// <returns></returns> public override bool Equals(object obj) { if (obj == null) { return(false); } if (Object.ReferenceEquals(this, obj)) { return(true); } if (this.GetType() != obj.GetType()) { return(false); } var other = (VLCredential)obj; //reference types if (!Object.Equals(LogOnToken, other.LogOnToken)) { return(false); } if (!Object.Equals(PswdToken, other.PswdToken)) { return(false); } if (!Object.Equals(PswdSalt, other.PswdSalt)) { return(false); } if (!Object.Equals(PswdQuestion, other.PswdQuestion)) { return(false); } if (!Object.Equals(PswdAnswer, other.PswdAnswer)) { return(false); } if (!Object.Equals(Comment, other.Comment)) { return(false); } //value types if (!CredentialId.Equals(other.CredentialId)) { return(false); } if (!Principal.Equals(other.Principal)) { return(false); } if (!PrincipalType.Equals(other.PrincipalType)) { return(false); } if (!PswdFormat.Equals(other.PswdFormat)) { return(false); } if (!IsApproved.Equals(other.IsApproved)) { return(false); } if (!IsLockedOut.Equals(other.IsLockedOut)) { return(false); } if (!LastLoginDate.Equals(other.LastLoginDate)) { return(false); } if (!LastPasswordChangedDate.Equals(other.LastPasswordChangedDate)) { return(false); } if (!LastLockoutDate.Equals(other.LastLockoutDate)) { return(false); } if (!FailedPasswordAttemptCount.Equals(other.FailedPasswordAttemptCount)) { return(false); } if (!FailedPasswordAttemptWindowStart.Equals(other.FailedPasswordAttemptWindowStart)) { return(false); } if (!FailedPasswordAnswerAttemptCount.Equals(other.FailedPasswordAnswerAttemptCount)) { return(false); } if (!FailedPasswordAnswerAttemptWindowStart.Equals(other.FailedPasswordAnswerAttemptWindowStart)) { return(false); } return(true); }