/// <summary> /// Returns true if CashFlow instances are equal /// </summary> /// <param name="other">Instance of CashFlow to be compared</param> /// <returns>Boolean</returns> public bool Equals(CashFlow other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Catar == other.Catar || Catar != null && Catar.Equals(other.Catar) ) && ( Fatar == other.Fatar || Fatar != null && Fatar.Equals(other.Fatar) ) && ( Tatar == other.Tatar || Tatar != null && Tatar.Equals(other.Tatar) ) && ( Ipm == other.Ipm || Ipm != null && Ipm.Equals(other.Ipm) ) && ( Oncforr == other.Oncforr || Oncforr != null && Oncforr.Equals(other.Oncforr) ) && ( Oncfnpr == other.Oncfnpr || Oncfnpr != null && Oncfnpr.Equals(other.Oncfnpr) ) && ( Oncfgrr == other.Oncfgrr || Oncfgrr != null && Oncfgrr.Equals(other.Oncfgrr) )); }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { int hashCode = 41; // Suitable nullity checks etc, of course :) if (Catar != null) { hashCode = hashCode * 59 + Catar.GetHashCode(); } if (Fatar != null) { hashCode = hashCode * 59 + Fatar.GetHashCode(); } if (Tatar != null) { hashCode = hashCode * 59 + Tatar.GetHashCode(); } if (Ipm != null) { hashCode = hashCode * 59 + Ipm.GetHashCode(); } if (Oncforr != null) { hashCode = hashCode * 59 + Oncforr.GetHashCode(); } if (Oncfnpr != null) { hashCode = hashCode * 59 + Oncfnpr.GetHashCode(); } if (Oncfgrr != null) { hashCode = hashCode * 59 + Oncfgrr.GetHashCode(); } return(hashCode); } }