public override int GetHashCode() { unchecked { int hash = 23; hash = hash * 37 + (Home != null ? Home.GetHashCode() : 0); hash = hash * 37 + (Away != null ? Away.GetHashCode() : 0); hash = hash * 37 + (ShortHome != null ? ShortHome.GetHashCode() : 0); hash = hash * 37 + (ShortAway != null ? ShortAway.GetHashCode() : 0); hash = hash * 37 + HomeScore.GetHashCode(); hash = hash * 37 + AwayScore.GetHashCode(); hash = hash * 37 + HomeFouls.GetHashCode(); hash = hash * 37 + AwayFouls.GetHashCode(); hash = hash * 37 + Period.GetHashCode(); hash = hash * 37 + PeriodType.GetHashCode(); hash = hash * 37 + IsTeamEdit.GetHashCode(); hash = hash * 37 + IsEndGame.GetHashCode(); hash = hash * 37 + HomeColor.GetHashCode(); hash = hash * 37 + AwayColor.GetHashCode(); hash = hash * 37 + (HomeLogo != null ? HomeLogo.GetHashCode() : 0); hash = hash * 37 + (AwayLogo != null ? AwayLogo.GetHashCode() : 0); hash = hash * 37 + (Configuration != null ? Configuration.GetHashCode() : 0); return(hash); } }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { // credit: http://stackoverflow.com/a/263416/677735 unchecked // Overflow is fine, just wrap { int hash = 41; // Suitable nullity checks hash = hash * 59 + RateType.GetHashCode(); hash = hash * 59 + Description.GetHashCode(); hash = hash * 59 + Active.GetHashCode(); hash = hash * 59 + PeriodType.GetHashCode(); if (Rate != null) { hash = hash * 59 + Rate.GetHashCode(); } hash = hash * 59 + IsPercentRate.GetHashCode(); hash = hash * 59 + IsRateEditable.GetHashCode(); hash = hash * 59 + IsIncludedInTotal.GetHashCode(); hash = hash * 59 + IsInTotalEditable.GetHashCode(); return(hash); } }
public override int GetHashCode() { unchecked { int hashCode = (DistributionPeriod != null ? DistributionPeriod.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Occurrence; hashCode = (hashCode * 397) ^ (Period != null ? Period.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (PeriodType != null ? PeriodType.GetHashCode() : 0); hashCode = (hashCode * 397) ^ PeriodYear; hashCode = (hashCode * 397) ^ ProfileValue.GetHashCode(); return(hashCode); } }