/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { int hashCode = 41; if (Type != null) { hashCode = hashCode * 59 + Type.GetHashCode(); } if (Name != null) { hashCode = hashCode * 59 + Name.GetHashCode(); } if (Label != null) { hashCode = hashCode * 59 + Label.GetHashCode(); } if (Category != null) { hashCode = hashCode * 59 + Category.GetHashCode(); } if (Tags != null) { hashCode = hashCode * 59 + Tags.GetHashCode(); } if (GroupNames != null) { hashCode = hashCode * 59 + GroupNames.GetHashCode(); } if (Link != null) { hashCode = hashCode * 59 + Link.GetHashCode(); } if (State != null) { hashCode = hashCode * 59 + State.GetHashCode(); } if (TransformedState != null) { hashCode = hashCode * 59 + TransformedState.GetHashCode(); } if (StateDescription != null) { hashCode = hashCode * 59 + StateDescription.GetHashCode(); } if (CommandDescription != null) { hashCode = hashCode * 59 + CommandDescription.GetHashCode(); } if (Metadata != null) { hashCode = hashCode * 59 + Metadata.GetHashCode(); } if (Editable != null) { hashCode = hashCode * 59 + Editable.GetHashCode(); } return(hashCode); } }
public override int GetHashCode() { unchecked { var hashCode = Type != null?Type.GetHashCode() : 0; hashCode = (hashCode * 397) ^ (Name != null ? Name.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Label != null ? Label.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Category != null ? Category.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Tags != null ? Tags.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (GroupNames != null ? GroupNames.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Link != null ? Link.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (State != null ? State.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (TransformedState != null ? TransformedState.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (StateDescription != null ? StateDescription.GetHashCode() : 0); return(hashCode); } }
/// <summary> /// Returns true if EnrichedItemDTO instances are equal /// </summary> /// <param name="input">Instance of EnrichedItemDTO to be compared</param> /// <returns>Boolean</returns> public bool Equals(EnrichedItemDTO input) { if (input == null) { return(false); } return (( Type == input.Type || (Type != null && Type.Equals(input.Type)) ) && ( Name == input.Name || (Name != null && Name.Equals(input.Name)) ) && ( Label == input.Label || (Label != null && Label.Equals(input.Label)) ) && ( Category == input.Category || (Category != null && Category.Equals(input.Category)) ) && ( Tags == input.Tags || Tags != null && Tags.SequenceEqual(input.Tags) ) && ( GroupNames == input.GroupNames || GroupNames != null && GroupNames.SequenceEqual(input.GroupNames) ) && ( Link == input.Link || (Link != null && Link.Equals(input.Link)) ) && ( State == input.State || (State != null && State.Equals(input.State)) ) && ( TransformedState == input.TransformedState || (TransformedState != null && TransformedState.Equals(input.TransformedState)) ) && ( StateDescription == input.StateDescription || (StateDescription != null && StateDescription.Equals(input.StateDescription)) ) && ( CommandDescription == input.CommandDescription || (CommandDescription != null && CommandDescription.Equals(input.CommandDescription)) ) && ( Metadata == input.Metadata || Metadata != null && Metadata.SequenceEqual(input.Metadata) ) && ( Editable == input.Editable || (Editable != null && Editable.Equals(input.Editable)) )); }