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