/// <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 (Calories != null) { hashCode = hashCode * 59 + Calories.GetHashCode(); } if (DailyValues != null) { hashCode = hashCode * 59 + DailyValues.GetHashCode(); } if (Fat != null) { hashCode = hashCode * 59 + Fat.GetHashCode(); } if (Carbs != null) { hashCode = hashCode * 59 + Carbs.GetHashCode(); } if (Vitamins != null) { hashCode = hashCode * 59 + Vitamins.GetHashCode(); } return(hashCode); } }
public override int GetHashCode() { unchecked { var hashCode = Calories.GetHashCode(); hashCode = (hashCode * 397) ^ (int)Allergens; hashCode = (hashCode * 397) ^ (int)Requirements; hashCode = (hashCode * 397) ^ (MacroNutrientQuantity != null ? MacroNutrientQuantity.GetHashCode() : 0); return(hashCode); } }
/// <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 (Description != null) { hashCode = hashCode * 59 + Description.GetHashCode(); } if (Photos != null) { hashCode = hashCode * 59 + Photos.GetHashCode(); } if (Gear != null) { hashCode = hashCode * 59 + Gear.GetHashCode(); } if (Calories != null) { hashCode = hashCode * 59 + Calories.GetHashCode(); } if (SegmentEfforts != null) { hashCode = hashCode * 59 + SegmentEfforts.GetHashCode(); } if (DeviceName != null) { hashCode = hashCode * 59 + DeviceName.GetHashCode(); } if (EmbedToken != null) { hashCode = hashCode * 59 + EmbedToken.GetHashCode(); } if (SplitsMetric != null) { hashCode = hashCode * 59 + SplitsMetric.GetHashCode(); } if (SplitsStandard != null) { hashCode = hashCode * 59 + SplitsStandard.GetHashCode(); } if (Laps != null) { hashCode = hashCode * 59 + Laps.GetHashCode(); } if (BestEfforts != null) { hashCode = hashCode * 59 + BestEfforts.GetHashCode(); } return(hashCode); } }
public override int GetHashCode() { var hashCode = -1245731201; hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(To); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(From); hashCode = hashCode * -1521134295 + StartTime.GetHashCode(); hashCode = hashCode * -1521134295 + EndTime.GetHashCode(); hashCode = hashCode * -1521134295 + TimeSpent.GetHashCode(); hashCode = hashCode * -1521134295 + Calories.GetHashCode(); hashCode = hashCode * -1521134295 + Cost.GetHashCode(); return(hashCode); }
public override int GetHashCode() { return(Calories.GetHashCode() ^ Name.GetHashCode() ^ Group.GetHashCode()); }
/// <summary> /// Получить числовое значение продукта /// </summary> /// <returns>Возвращает Hash Code продукта</returns> public override int GetHashCode() { return(CompositionList.GetHashCode() + Calories.GetHashCode() + Price.GetHashCode() + MarginCoefficient.GetHashCode() + CategoryName.GetHashCode() + ProductName.GetHashCode()); }