/// <inheritdoc/> public override int GetHashCode() => Role.GetHashCode() ^ Name.GetHashCode() ^ Value.GetHashCode() ^ Description.GetHashCode() ^ KeyShortcuts.GetHashCode() ^ RoleDescription.GetHashCode() ^ ValueText.GetHashCode() ^ AutoComplete.GetHashCode() ^ HasPopup.GetHashCode() ^ Orientation.GetHashCode() ^ Disabled.GetHashCode() ^ Expanded.GetHashCode() ^ Focused.GetHashCode() ^ Modal.GetHashCode() ^ Multiline.GetHashCode() ^ Multiselectable.GetHashCode() ^ Readonly.GetHashCode() ^ Required.GetHashCode() ^ Selected.GetHashCode() ^ Pressed.GetHashCode() ^ Checked.GetHashCode() ^ Level.GetHashCode() ^ ValueMin.GetHashCode() ^ ValueMax.GetHashCode() ^ Children.GetHashCode();
// Handle hashes for everything but the managers / service owners isCertified and the // risk rating. The isCertified stuff gets reset everytime a new cycle happens and // risk rating is calculated from threat and likelihood ratings so we can ignore those public override int GetHashCode() { int hashUserId = UserId == null ? 0 : UserId.GetHashCode(); int hashUserFullName = UserFullName == null ? 0 : UserFullName.GetHashCode(); int hashRoleId = RoleId == null ? 0 : RoleId.GetHashCode(); int hashRoleName = RoleName == null ? 0 : RoleName.GetHashCode(); int hashRoleDescription = RoleDescription == null ? 0 : RoleDescription.GetHashCode(); int hashRoleOwner_RoleId = RoleOwner_RoleId == null ? 0 : RoleOwner_RoleId.GetHashCode(); int hashLastCertifiedBy = LastCertifiedBy == null ? 0 : LastCertifiedBy.GetHashCode(); int hashLastCertifiedDate = LastCertifiedDate == null ? 0 : LastCertifiedDate.GetHashCode(); // Calculate the hash code for the object. return(hashUserId ^ hashUserFullName ^ hashRoleId ^ hashRoleName ^ hashRoleDescription ^ hashRoleOwner_RoleId ^ hashLastCertifiedBy ^ hashLastCertifiedDate); }
/// <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 (Id != null) { hashCode = hashCode * 59 + Id.GetHashCode(); } if (Name != null) { hashCode = hashCode * 59 + Name.GetHashCode(); } if (ContractTypeName != null) { hashCode = hashCode * 59 + ContractTypeName.GetHashCode(); } if (RoleId != null) { hashCode = hashCode * 59 + RoleId.GetHashCode(); } if (RoleName != null) { hashCode = hashCode * 59 + RoleName.GetHashCode(); } if (RoleDescription != null) { hashCode = hashCode * 59 + RoleDescription.GetHashCode(); } if (HourlySalary != null) { hashCode = hashCode * 59 + HourlySalary.GetHashCode(); } if (MonthlySalary != null) { hashCode = hashCode * 59 + MonthlySalary.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 (PersonId != null) { hashCode = hashCode * 59 + PersonId.GetHashCode(); } if (Name != null) { hashCode = hashCode * 59 + Name.GetHashCode(); } if (Status != null) { hashCode = hashCode * 59 + Status.GetHashCode(); } if (Role != null) { hashCode = hashCode * 59 + Role.GetHashCode(); } if (RoleDescription != null) { hashCode = hashCode * 59 + RoleDescription.GetHashCode(); } if (Lat != null) { hashCode = hashCode * 59 + Lat.GetHashCode(); } if (Lon != null) { hashCode = hashCode * 59 + Lon.GetHashCode(); } if (Timestamp != null) { hashCode = hashCode * 59 + Timestamp.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 (Id != null) { hashCode = hashCode * 59 + Id.GetHashCode(); } if (FullName != null) { hashCode = hashCode * 59 + FullName.GetHashCode(); } if (Phone != null) { hashCode = hashCode * 59 + Phone.GetHashCode(); } if (Email != null) { hashCode = hashCode * 59 + Email.GetHashCode(); } if (Role != null) { hashCode = hashCode * 59 + Role.GetHashCode(); } if (RoleDescription != null) { hashCode = hashCode * 59 + RoleDescription.GetHashCode(); } if (Active != null) { hashCode = hashCode * 59 + Active.GetHashCode(); } return(hashCode); } }
// Handle hashes for everything but the managers / service owners isCertified and the // risk rating. The isCertified stuff gets reset everytime a new cycle happens and // risk rating is calculated from threat and likelihood ratings so we can ignore those public override int GetHashCode() { // Role stuff int hashRolePrivId = RolePrivId == null ? 0 : RolePrivId.GetHashCode(); int hashRoleId = RoleId == null ? 0 : RoleId.GetHashCode(); int hashRoleName = RoleName == null ? 0 : RoleName.GetHashCode(); int hashRoleDescription = RoleDescription == null ? 0 : RoleDescription.GetHashCode(); int hashRoleOwner_RoleId = RoleOwner_RoleId == null ? 0 : RoleOwner_RoleId.GetHashCode(); // Manager stuff int hashRoleOwner_PrivId = RoleOwner_PrivId == null ? 0 : RoleOwner_PrivId.GetHashCode(); int hashRoleOwner_PermissionGroup = RoleOwner_PermissionGroup == null ? 0 : RoleOwner_PermissionGroup.GetHashCode(); int hashRoleOwner_ServicePrivSummary = RoleOwner_ServicePrivSummary == null ? 0 : RoleOwner_ServicePrivSummary.GetHashCode(); int hashRoleOwner_CredentialStorageMethod = RoleOwner_CredentialStorageMethod == null ? 0 : RoleOwner_CredentialStorageMethod.GetHashCode(); int hashRoleOwner_ServiceId = RoleOwner_ServiceId == null ? 0 : RoleOwner_ServiceId.GetHashCode(); int hashRoleOwner_ServiceName = RoleOwner_ServiceName == null ? 0 : RoleOwner_ServiceName.GetHashCode(); int hashRoleOwner_ServiceDescription = RoleOwner_ServiceDescription == null ? 0 : RoleOwner_ServiceDescription.GetHashCode(); int hashRoleOwner_RoleAccessJustification = RoleOwner_RoleAccessJustification == null ? 0 : RoleOwner_RoleAccessJustification.GetHashCode(); int hashRoleOwner_RemovalImpact = RoleOwner_RemovalImpact == null ? 0 : RoleOwner_RemovalImpact.GetHashCode(); int hashRoleOwner_IsRevoked = RoleOwner_IsRevoked == null ? 0 : RoleOwner_IsRevoked.GetHashCode(); int hashRoleOwner_DateCertified = RoleOwner_DateCertified == null ? 0 : RoleOwner_DateCertified.GetHashCode(); // Service Owner Stuff int hashServiceOwner_PrivId = ServiceOwner_PrivId == null ? 0 : ServiceOwner_PrivId.GetHashCode(); int hashServiceOwner_PermissionGroup = ServiceOwner_PermissionGroup == null ? 0 : ServiceOwner_PermissionGroup.GetHashCode(); int hashServiceOwner_ServicePrivSummary = ServiceOwner_ServicePrivSummary == null ? 0 : ServiceOwner_ServicePrivSummary.GetHashCode(); int hashServiceOwner_CredentialStorageMethod = ServiceOwner_CredentialStorageMethod == null ? 0 : ServiceOwner_CredentialStorageMethod.GetHashCode(); int hashServiceOwner_ServiceId = ServiceOwner_ServiceId == null ? 0 : ServiceOwner_ServiceId.GetHashCode(); int hashServiceOwner_ServiceName = ServiceOwner_ServiceName == null ? 0 : ServiceOwner_ServiceName.GetHashCode(); int hashServiceOwner_ServiceDescription = ServiceOwner_ServiceDescription == null ? 0 : ServiceOwner_ServiceDescription.GetHashCode(); int hashServiceOwner_RoleAccessJustification = ServiceOwner_RoleAccessJustification == null ? 0 : ServiceOwner_RoleAccessJustification.GetHashCode(); int hashServiceOwner_RemovalImpact = ServiceOwner_RemovalImpact == null ? 0 : ServiceOwner_RemovalImpact.GetHashCode(); int hashServiceOwner_IsRevoked = ServiceOwner_IsRevoked == null ? 0 : ServiceOwner_IsRevoked.GetHashCode(); int hashServiceOwner_DateCertified = ServiceOwner_DateCertified == null ? 0 : ServiceOwner_DateCertified.GetHashCode(); // Risk Stuff int hashRiskImpact = RiskImpact == null ? 0 : RiskImpact.GetHashCode(); int hashRiskLikelihood = RiskLikelihood == null ? 0 : RiskLikelihood.GetHashCode(); int hashRiskNotes = RiskNotes == null ? 0 : RiskNotes.GetHashCode(); int hashRiskAssessmentDate = RiskAssessmentDate == null ? 0 : ServiceOwner_DateCertified.GetHashCode(); // Calculate the hash code for the object. return // Role stuff (hashRolePrivId ^ hashRoleId ^ hashRoleName ^ hashRoleDescription ^ hashRoleOwner_RoleId ^ // Manager stuff hashRoleOwner_PrivId ^ hashRoleOwner_PermissionGroup ^ hashRoleOwner_ServicePrivSummary ^ hashRoleOwner_CredentialStorageMethod ^ hashRoleOwner_ServiceId ^ hashRoleOwner_ServiceName ^ hashRoleOwner_ServiceDescription ^ hashRoleOwner_RoleAccessJustification ^ hashRoleOwner_RemovalImpact ^ hashRoleOwner_IsRevoked ^ hashRoleOwner_DateCertified ^ // Service Owner Stuff hashServiceOwner_PrivId ^ hashServiceOwner_PermissionGroup ^ hashServiceOwner_ServicePrivSummary ^ hashServiceOwner_CredentialStorageMethod ^ hashServiceOwner_ServiceId ^ hashServiceOwner_ServiceName ^ hashServiceOwner_ServiceDescription ^ hashServiceOwner_RoleAccessJustification ^ hashServiceOwner_RemovalImpact ^ hashServiceOwner_IsRevoked ^ hashServiceOwner_DateCertified ^ // Risk Stuff hashRiskImpact ^ hashRiskLikelihood ^ hashRiskNotes ^ hashRiskAssessmentDate); }