Ejemplo n.º 1
0
 public override int GetHashCode()
 {
     unchecked
     {
         int hash = 17;
         hash = hash * 23 + (Class == null ? 0 : Class.GetHashCode());
         hash = hash * 23 + (Color == null ? 0 : Color.GetHashCode());
         hash = hash * 23 + (DaysToManufacture == default(int) ? 0 : DaysToManufacture.GetHashCode());
         hash = hash * 23 + (DiscontinuedDate == null ? 0 : DiscontinuedDate.GetHashCode());
         hash = hash * 23 + (FinishedGoodsFlag == default(bool) ? 0 : FinishedGoodsFlag.GetHashCode());
         hash = hash * 23 + (ListPrice == default(decimal) ? 0 : ListPrice.GetHashCode());
         hash = hash * 23 + (MakeFlag == default(bool) ? 0 : MakeFlag.GetHashCode());
         hash = hash * 23 + (ModifiedDate == default(DateTime) ? 0 : ModifiedDate.GetHashCode());
         hash = hash * 23 + (Name == null ? 0 : Name.GetHashCode());
         hash = hash * 23 + (ProductLine == null ? 0 : ProductLine.GetHashCode());
         hash = hash * 23 + (ProductModelId == null ? 0 : ProductModelId.GetHashCode());
         hash = hash * 23 + (ProductNumber == null ? 0 : ProductNumber.GetHashCode());
         hash = hash * 23 + (ProductSubcategoryId == null ? 0 : ProductSubcategoryId.GetHashCode());
         hash = hash * 23 + (ReorderPoint == default(short) ? 0 : ReorderPoint.GetHashCode());
         hash = hash * 23 + (Rowguid == default(Guid) ? 0 : Rowguid.GetHashCode());
         hash = hash * 23 + (SafetyStockLevel == default(short) ? 0 : SafetyStockLevel.GetHashCode());
         hash = hash * 23 + (SellEndDate == null ? 0 : SellEndDate.GetHashCode());
         hash = hash * 23 + (SellStartDate == default(DateTime) ? 0 : SellStartDate.GetHashCode());
         hash = hash * 23 + (Size == null ? 0 : Size.GetHashCode());
         hash = hash * 23 + (SizeUnitMeasureCode == null ? 0 : SizeUnitMeasureCode.GetHashCode());
         hash = hash * 23 + (StandardCost == default(decimal) ? 0 : StandardCost.GetHashCode());
         hash = hash * 23 + (Style == null ? 0 : Style.GetHashCode());
         hash = hash * 23 + (Weight == null ? 0 : Weight.GetHashCode());
         hash = hash * 23 + (WeightUnitMeasureCode == null ? 0 : WeightUnitMeasureCode.GetHashCode());
         return(hash);
     }
 }
Ejemplo n.º 2
0
 /// <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 (ProductId != null)
         {
             hashCode = hashCode * 59 + ProductId.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (ProductNumber != null)
         {
             hashCode = hashCode * 59 + ProductNumber.GetHashCode();
         }
         if (Color != null)
         {
             hashCode = hashCode * 59 + Color.GetHashCode();
         }
         if (StandardCost != null)
         {
             hashCode = hashCode * 59 + StandardCost.GetHashCode();
         }
         if (ListPrice != null)
         {
             hashCode = hashCode * 59 + ListPrice.GetHashCode();
         }
         if (Size != null)
         {
             hashCode = hashCode * 59 + Size.GetHashCode();
         }
         if (Weight != null)
         {
             hashCode = hashCode * 59 + Weight.GetHashCode();
         }
         if (ProductLine != null)
         {
             hashCode = hashCode * 59 + ProductLine.GetHashCode();
         }
         if (Class != null)
         {
             hashCode = hashCode * 59 + Class.GetHashCode();
         }
         if (Style != null)
         {
             hashCode = hashCode * 59 + Style.GetHashCode();
         }
         if (SubCategory != null)
         {
             hashCode = hashCode * 59 + SubCategory.GetHashCode();
         }
         if (Model != null)
         {
             hashCode = hashCode * 59 + Model.GetHashCode();
         }
         if (Photo != null)
         {
             hashCode = hashCode * 59 + Photo.GetHashCode();
         }
         if (Review != null)
         {
             hashCode = hashCode * 59 + Review.GetHashCode();
         }
         return(hashCode);
     }
 }