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

            return
                ((
                     Size == other.Size ||
                     Size != null &&
                     Size.Equals(other.Size)
                     ) &&
                 (
                     MeasurementUnit == other.MeasurementUnit ||
                     MeasurementUnit != null &&
                     MeasurementUnit.Equals(other.MeasurementUnit)
                 ) &&
                 (
                     SizeFulltext == other.SizeFulltext ||
                     SizeFulltext != null &&
                     SizeFulltext.Equals(other.SizeFulltext)
                 ));
        }
Example #2
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)
                 ));
        }
Example #3
0
        /// <summary>
        /// Returns true if BrandedFoodObjectNutrients instances are equal
        /// </summary>
        /// <param name="other">Instance of BrandedFoodObjectNutrients to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(BrandedFoodObjectNutrients other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                     ) &&
                 (
                     Per100g == other.Per100g ||
                     Per100g != null &&
                     Per100g.Equals(other.Per100g)
                 ) &&
                 (
                     MeasurementUnit == other.MeasurementUnit ||
                     MeasurementUnit != null &&
                     MeasurementUnit.Equals(other.MeasurementUnit)
                 ) &&
                 (
                     Rank == other.Rank ||
                     Rank != null &&
                     Rank.Equals(other.Rank)
                 ) &&
                 (
                     DataPoints == other.DataPoints ||
                     DataPoints != null &&
                     DataPoints.Equals(other.DataPoints)
                 ) &&
                 (
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                 ));
        }
Example #4
0
 /// <summary>
 /// Better equals to increase performance by saving boxing
 /// </summary>
 /// <param name="valueType"></param>
 /// <returns>true if the given value type is equal to this one and false otherwise</returns>
 public bool Equals(NICEMetric valueType)
 {
     if (valueType == null)
     {
         return(false);
     }
     if (ReferenceEquals(this, valueType))
     {
         return(true);
     }
     if ((Type != valueType.Type) || (!Name.Equals(valueType.Name, StringComparison.OrdinalIgnoreCase)) ||
         (!Group.Equals(valueType.Group, StringComparison.OrdinalIgnoreCase)) ||
         (!MeasurementUnit.Equals(valueType.MeasurementUnit, StringComparison.OrdinalIgnoreCase)) ||
         (IsAggregationEnable != valueType.IsAggregationEnable)
         )
     {
         return(false);
     }
     return(true);
 }
Example #5
0
        /// <summary>
        /// Returns true if IngredientObjectNutrients instances are equal
        /// </summary>
        /// <param name="other">Instance of IngredientObjectNutrients to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(IngredientObjectNutrients other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                     ) &&
                 (
                     Per100g == other.Per100g ||
                     Per100g != null &&
                     Per100g.Equals(other.Per100g)
                 ) &&
                 (
                     MeasurementUnit == other.MeasurementUnit ||
                     MeasurementUnit != null &&
                     MeasurementUnit.Equals(other.MeasurementUnit)
                 ) &&
                 (
                     Min == other.Min ||
                     Min != null &&
                     Min.Equals(other.Min)
                 ) &&
                 (
                     Max == other.Max ||
                     Max != null &&
                     Max.Equals(other.Max)
                 ) &&
                 (
                     Median == other.Median ||
                     Median != null &&
                     Median.Equals(other.Median)
                 ) &&
                 (
                     Rank == other.Rank ||
                     Rank != null &&
                     Rank.Equals(other.Rank)
                 ) &&
                 (
                     DataPoints == other.DataPoints ||
                     DataPoints != null &&
                     DataPoints.Equals(other.DataPoints)
                 ) &&
                 (
                     Footnote == other.Footnote ||
                     Footnote != null &&
                     Footnote.Equals(other.Footnote)
                 ) &&
                 (
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                 ));
        }