/// <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 (Id != null) { hashCode = hashCode * 59 + Id.GetHashCode(); } if (Title != null) { hashCode = hashCode * 59 + Title.GetHashCode(); } if (Meta != null) { hashCode = hashCode * 59 + Meta.GetHashCode(); } if (Categories != null) { hashCode = hashCode * 59 + Categories.GetHashCode(); } if (Author != null) { hashCode = hashCode * 59 + Author.GetHashCode(); } if (Keywords != null) { hashCode = hashCode * 59 + Keywords.GetHashCode(); } if (Topics != null) { hashCode = hashCode * 59 + Topics.GetHashCode(); } if (Attributes != null) { hashCode = hashCode * 59 + Attributes.GetHashCode(); } if (Ingredients != null) { hashCode = hashCode * 59 + Ingredients.GetHashCode(); } if (BaseIngredients != null) { hashCode = hashCode * 59 + BaseIngredients.GetHashCode(); } if (Nutrients != null) { hashCode = hashCode * 59 + Nutrients.GetHashCode(); } if (DiabeticExchanges != null) { hashCode = hashCode * 59 + DiabeticExchanges.GetHashCode(); } return(hashCode); } }
/// <summary> /// Returns true if RecipeObjectItems instances are equal /// </summary> /// <param name="other">Instance of RecipeObjectItems to be compared</param> /// <returns>Boolean</returns> public bool Equals(RecipeObjectItems other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Id == other.Id || Id != null && Id.Equals(other.Id) ) && ( Title == other.Title || Title != null && Title.Equals(other.Title) ) && ( Meta == other.Meta || Meta != null && Meta.Equals(other.Meta) ) && ( Categories == other.Categories || Categories != null && Categories.SequenceEqual(other.Categories) ) && ( Author == other.Author || Author != null && Author.Equals(other.Author) ) && ( Keywords == other.Keywords || Keywords != null && Keywords.SequenceEqual(other.Keywords) ) && ( Topics == other.Topics || Topics != null && Topics.SequenceEqual(other.Topics) ) && ( Attributes == other.Attributes || Attributes != null && Attributes.Equals(other.Attributes) ) && ( Ingredients == other.Ingredients || Ingredients != null && Ingredients.SequenceEqual(other.Ingredients) ) && ( BaseIngredients == other.BaseIngredients || BaseIngredients != null && BaseIngredients.SequenceEqual(other.BaseIngredients) ) && ( Nutrients == other.Nutrients || Nutrients != null && Nutrients.Equals(other.Nutrients) ) && ( DiabeticExchanges == other.DiabeticExchanges || DiabeticExchanges != null && DiabeticExchanges.SequenceEqual(other.DiabeticExchanges) )); }