コード例 #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 (SortId != null)
         {
             hashCode = hashCode * 59 + SortId.GetHashCode();
         }
         if (MinNumOptions != null)
         {
             hashCode = hashCode * 59 + MinNumOptions.GetHashCode();
         }
         if (MaxNumOptions != null)
         {
             hashCode = hashCode * 59 + MaxNumOptions.GetHashCode();
         }
         if (NumFreeOptions != null)
         {
             hashCode = hashCode * 59 + NumFreeOptions.GetHashCode();
         }
         if (MinOptionChoiceQuantity != null)
         {
             hashCode = hashCode * 59 + MinOptionChoiceQuantity.GetHashCode();
         }
         if (MaxOptionChoiceQuantity != null)
         {
             hashCode = hashCode * 59 + MaxOptionChoiceQuantity.GetHashCode();
         }
         if (MinAggregateOptionsQuantity != null)
         {
             hashCode = hashCode * 59 + MinAggregateOptionsQuantity.GetHashCode();
         }
         if (MaxAggregateOptionsQuantity != null)
         {
             hashCode = hashCode * 59 + MaxAggregateOptionsQuantity.GetHashCode();
         }
         if (Options != null)
         {
             hashCode = hashCode * 59 + Options.GetHashCode();
         }
         return(hashCode);
     }
 }
コード例 #2
0
        /// <summary>
        /// Returns true if NestedL2ItemExtra instances are equal
        /// </summary>
        /// <param name="input">Instance of NestedL2ItemExtra to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(NestedL2ItemExtra 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)
                 ) &&
                 (
                     SortId == input.SortId ||
                     SortId != null &&
                     SortId.Equals(input.SortId)
                 ) &&
                 (
                     MinNumOptions == input.MinNumOptions ||
                     MinNumOptions != null &&
                     MinNumOptions.Equals(input.MinNumOptions)
                 ) &&
                 (
                     MaxNumOptions == input.MaxNumOptions ||
                     MaxNumOptions != null &&
                     MaxNumOptions.Equals(input.MaxNumOptions)
                 ) &&
                 (
                     NumFreeOptions == input.NumFreeOptions ||
                     NumFreeOptions != null &&
                     NumFreeOptions.Equals(input.NumFreeOptions)
                 ) &&
                 (
                     MinOptionChoiceQuantity == input.MinOptionChoiceQuantity ||
                     MinOptionChoiceQuantity != null &&
                     MinOptionChoiceQuantity.Equals(input.MinOptionChoiceQuantity)
                 ) &&
                 (
                     MaxOptionChoiceQuantity == input.MaxOptionChoiceQuantity ||
                     MaxOptionChoiceQuantity != null &&
                     MaxOptionChoiceQuantity.Equals(input.MaxOptionChoiceQuantity)
                 ) &&
                 (
                     MinAggregateOptionsQuantity == input.MinAggregateOptionsQuantity ||
                     MinAggregateOptionsQuantity != null &&
                     MinAggregateOptionsQuantity.Equals(input.MinAggregateOptionsQuantity)
                 ) &&
                 (
                     MaxAggregateOptionsQuantity == input.MaxAggregateOptionsQuantity ||
                     MaxAggregateOptionsQuantity != null &&
                     MaxAggregateOptionsQuantity.Equals(input.MaxAggregateOptionsQuantity)
                 ) &&
                 (
                     Options == input.Options ||
                     Options != null &&
                     Options.SequenceEqual(input.Options)
                 ));
        }