예제 #1
0
        /// <summary>
        /// Returns true if IngredientObjectPortions instances are equal
        /// </summary>
        /// <param name="other">Instance of IngredientObjectPortions to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(IngredientObjectPortions other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     MeasurementUnit == other.MeasurementUnit ||
                     MeasurementUnit != null &&
                     MeasurementUnit.Equals(other.MeasurementUnit)
                     ) &&
                 (
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                 ) &&
                 (
                     Modifier == other.Modifier ||
                     Modifier != null &&
                     Modifier.Equals(other.Modifier)
                 ) &&
                 (
                     GramWeight == other.GramWeight ||
                     GramWeight != null &&
                     GramWeight.Equals(other.GramWeight)
                 ) &&
                 (
                     DataPoints == other.DataPoints ||
                     DataPoints != null &&
                     DataPoints.Equals(other.DataPoints)
                 ) &&
                 (
                     Footnote == other.Footnote ||
                     Footnote != null &&
                     Footnote.Equals(other.Footnote)
                 ));
        }
        /// <summary>
        /// Returns true if IngredientObjectComponents instances are equal
        /// </summary>
        /// <param name="other">Instance of IngredientObjectComponents to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(IngredientObjectComponents other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                     ) &&
                 (
                     PctWeight == other.PctWeight ||
                     PctWeight != null &&
                     PctWeight.Equals(other.PctWeight)
                 ) &&
                 (
                     GramWeight == other.GramWeight ||
                     GramWeight != null &&
                     GramWeight.Equals(other.GramWeight)
                 ) &&
                 (
                     IsRefuse == other.IsRefuse ||
                     IsRefuse != null &&
                     IsRefuse.Equals(other.IsRefuse)
                 ) &&
                 (
                     DataPoints == other.DataPoints ||
                     DataPoints != null &&
                     DataPoints.Equals(other.DataPoints)
                 ));
        }