/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { // credit: http://stackoverflow.com/a/263416/677735 unchecked // Overflow is fine, just wrap { int hash = 41; // Suitable nullity checks hash = hash * 59 + RateType.GetHashCode(); hash = hash * 59 + Description.GetHashCode(); hash = hash * 59 + Active.GetHashCode(); hash = hash * 59 + PeriodType.GetHashCode(); if (Rate != null) { hash = hash * 59 + Rate.GetHashCode(); } hash = hash * 59 + IsPercentRate.GetHashCode(); hash = hash * 59 + IsRateEditable.GetHashCode(); hash = hash * 59 + IsIncludedInTotal.GetHashCode(); hash = hash * 59 + IsInTotalEditable.GetHashCode(); return(hash); } }
/// <summary> /// Returns true if ProvincialRateType instances are equal /// </summary> /// <param name="other">Instance of ProvincialRateType to be compared</param> /// <returns>Boolean</returns> public bool Equals(ProvincialRateType other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( RateType == other.RateType || RateType.Equals(other.RateType) ) && ( Description == other.Description || Description.Equals(other.Description) ) && ( Active == other.Active || Active.Equals(other.Active) ) && ( PeriodType == other.PeriodType || PeriodType != null && PeriodType.Equals(other.PeriodType) ) && ( Rate == other.Rate || Rate != null && Rate.Equals(other.Rate) ) && ( IsPercentRate == other.IsPercentRate || IsPercentRate.Equals(other.IsPercentRate) ) && ( IsRateEditable == other.IsRateEditable || IsRateEditable.Equals(other.IsRateEditable) ) && ( IsIncludedInTotal == other.IsIncludedInTotal || IsIncludedInTotal.Equals(other.IsIncludedInTotal) ) && ( IsInTotalEditable == other.IsInTotalEditable || IsInTotalEditable.Equals(other.IsInTotalEditable) )); }