public override int GetHashCode() { var hashCode = 525988058; hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(ProductName); hashCode = hashCode * -1521134295 + ProductPrice.GetHashCode(); hashCode = hashCode * -1521134295 + ProductAmount.GetHashCode(); return(hashCode); }
public override int GetHashCode() { var hashCode = -2027619230; hashCode = hashCode * -1521134295 + ProductID.GetHashCode(); hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(ProductName); hashCode = hashCode * -1521134295 + ProductPrice.GetHashCode(); hashCode = hashCode * -1521134295 + ProductQuantity.GetHashCode(); 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 (DiscountAmount != null) { hashCode = hashCode * 59 + DiscountAmount.GetHashCode(); } if (GoogleProductCategoryId != null) { hashCode = hashCode * 59 + GoogleProductCategoryId.GetHashCode(); } if (LineAmountTotal != null) { hashCode = hashCode * 59 + LineAmountTotal.GetHashCode(); } if (ProductCategory != null) { hashCode = hashCode * 59 + ProductCategory.GetHashCode(); } if (ProductCode != null) { hashCode = hashCode * 59 + ProductCode.GetHashCode(); } if (ProductName != null) { hashCode = hashCode * 59 + ProductName.GetHashCode(); } if (ProductPrice != null) { hashCode = hashCode * 59 + ProductPrice.GetHashCode(); } if (ProductType != null) { hashCode = hashCode * 59 + ProductType.GetHashCode(); } if (Quantity != null) { hashCode = hashCode * 59 + Quantity.GetHashCode(); } if (TaxAmount != null) { hashCode = hashCode * 59 + TaxAmount.GetHashCode(); } if (Unit != null) { hashCode = hashCode * 59 + Unit.GetHashCode(); } return(hashCode); } }