Beispiel #1
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         int hashCode = 41;
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (Description != null)
         {
             hashCode = hashCode * 59 + Description.GetHashCode();
         }
         if (MerchantSuppliedId != null)
         {
             hashCode = hashCode * 59 + MerchantSuppliedId.GetHashCode();
         }
         if (Active != null)
         {
             hashCode = hashCode * 59 + Active.GetHashCode();
         }
         if (IsAlcohol != null)
         {
             hashCode = hashCode * 59 + IsAlcohol.GetHashCode();
         }
         if (IsBikeFriendly != null)
         {
             hashCode = hashCode * 59 + IsBikeFriendly.GetHashCode();
         }
         if (SortId != null)
         {
             hashCode = hashCode * 59 + SortId.GetHashCode();
         }
         if (Price != null)
         {
             hashCode = hashCode * 59 + Price.GetHashCode();
         }
         if (BasePrice != null)
         {
             hashCode = hashCode * 59 + BasePrice.GetHashCode();
         }
         if (Extras != null)
         {
             hashCode = hashCode * 59 + Extras.GetHashCode();
         }
         if (TaxRate != null)
         {
             hashCode = hashCode * 59 + TaxRate.GetHashCode();
         }
         if (OriginalImageUrl != null)
         {
             hashCode = hashCode * 59 + OriginalImageUrl.GetHashCode();
         }
         return(hashCode);
     }
 }
Beispiel #2
0
        /// <summary>
        /// Returns true if Item instances are equal
        /// </summary>
        /// <param name="input">Instance of Item to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Item input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     Name == input.Name ||
                     Name != null &&
                     Name.Equals(input.Name)
                     ) &&
                 (
                     Description == input.Description ||
                     Description != null &&
                     Description.Equals(input.Description)
                 ) &&
                 (
                     MerchantSuppliedId == input.MerchantSuppliedId ||
                     MerchantSuppliedId != null &&
                     MerchantSuppliedId.Equals(input.MerchantSuppliedId)
                 ) &&
                 (
                     Active == input.Active ||
                     Active != null &&
                     Active.Equals(input.Active)
                 ) &&
                 (
                     IsAlcohol == input.IsAlcohol ||
                     IsAlcohol != null &&
                     IsAlcohol.Equals(input.IsAlcohol)
                 ) &&
                 (
                     IsBikeFriendly == input.IsBikeFriendly ||
                     IsBikeFriendly != null &&
                     IsBikeFriendly.Equals(input.IsBikeFriendly)
                 ) &&
                 (
                     SortId == input.SortId ||
                     SortId != null &&
                     SortId.Equals(input.SortId)
                 ) &&
                 (
                     Price == input.Price ||
                     Price != null &&
                     Price.Equals(input.Price)
                 ) &&
                 (
                     BasePrice == input.BasePrice ||
                     BasePrice != null &&
                     BasePrice.Equals(input.BasePrice)
                 ) &&
                 (
                     Extras == input.Extras ||
                     Extras != null &&
                     Extras.SequenceEqual(input.Extras)
                 ) &&
                 (
                     TaxRate == input.TaxRate ||
                     TaxRate != null &&
                     TaxRate.Equals(input.TaxRate)
                 ) &&
                 (
                     OriginalImageUrl == input.OriginalImageUrl ||
                     OriginalImageUrl != null &&
                     OriginalImageUrl.Equals(input.OriginalImageUrl)
                 ));
        }