/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { int hashCode = 41; // Suitable nullity checks etc, of course :) hashCode = hashCode * 59 + EnergyCubes.GetHashCode(); hashCode = hashCode * 59 + Health.GetHashCode(); hashCode = hashCode * 59 + Active.GetHashCode(); hashCode = hashCode * 59 + Virtual.GetHashCode(); hashCode = hashCode * 59 + Priority.GetHashCode(); hashCode = hashCode * 59 + OnTurn.GetHashCode(); hashCode = hashCode * 59 + IsMine.GetHashCode(); hashCode = hashCode * 59 + HandCards.GetHashCode(); hashCode = hashCode * 59 + Attitude.GetHashCode(); hashCode = hashCode * 59 + Type.GetHashCode(); return(hashCode); } }
public override int GetHashCode() { unchecked { var hashCode = Attributes != null?Attributes.GetHashCode() : 0; hashCode = (hashCode * 397) ^ (CatalogVisibility != null ? CatalogVisibility.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Categories != null ? Categories.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Description != null ? Description.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (ExternalUrl != null ? ExternalUrl.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Featured.GetHashCode(); hashCode = (hashCode * 397) ^ Id; hashCode = (hashCode * 397) ^ (Images != null ? Images.GetHashCode() : 0); hashCode = (hashCode * 397) ^ InStock.GetHashCode(); hashCode = (hashCode * 397) ^ ManageStock.GetHashCode(); hashCode = (hashCode * 397) ^ (Name != null ? Name.GetHashCode() : 0); hashCode = (hashCode * 397) ^ OnSale.GetHashCode(); hashCode = (hashCode * 397) ^ ParentId; hashCode = (hashCode * 397) ^ (Permalink != null ? Permalink.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Price != null ? Price.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (PriceHtml != null ? PriceHtml.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Purchasable.GetHashCode(); hashCode = (hashCode * 397) ^ (RegularPrice != null ? RegularPrice.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (RelatedIds != null ? RelatedIds.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (SalePrice != null ? SalePrice.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (ShortDescription != null ? ShortDescription.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Sku != null ? Sku.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Slug != null ? Slug.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Status != null ? Status.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (StockQuantity != null ? StockQuantity.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (Tags != null ? Tags.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (TaxClass != null ? TaxClass.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (TaxStatus != null ? TaxStatus.GetHashCode() : 0); hashCode = (hashCode * 397) ^ TotalSales; hashCode = (hashCode * 397) ^ (Type != null ? Type.GetHashCode() : 0); hashCode = (hashCode * 397) ^ Virtual.GetHashCode(); return(hashCode); } }