/// <summary> /// Returns true if DutyCascadeEvent instances are equal /// </summary> /// <param name="other">Instance of DutyCascadeEvent to be compared</param> /// <returns>Boolean</returns> public bool Equals(DutyCascadeEvent other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( DutyId == other.DutyId || DutyId != null && DutyId.Equals(other.DutyId) ) && ( CascadeFrom == other.CascadeFrom || CascadeFrom.Equals(other.CascadeFrom) ) && ( CascadeTo == other.CascadeTo || CascadeTo.Equals(other.CascadeTo) ) && ( IsDutyReset == other.IsDutyReset || IsDutyReset.Equals(other.IsDutyReset) )); }
/// <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 (DutyId != null) { hashCode = hashCode * 59 + DutyId.GetHashCode(); } hashCode = hashCode * 59 + CascadeFrom.GetHashCode(); hashCode = hashCode * 59 + CascadeTo.GetHashCode(); hashCode = hashCode * 59 + IsDutyReset.GetHashCode(); return(hashCode); } }