Example #1
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 (Code != null)
         {
             hashCode = hashCode * 59 + Code.GetHashCode();
         }
         if (ChargingTriggerInfo != null)
         {
             hashCode = hashCode * 59 + ChargingTriggerInfo.GetHashCode();
         }
         if (EventLimitQuantity != null)
         {
             hashCode = hashCode * 59 + EventLimitQuantity.GetHashCode();
         }
         if (FreeEventQuantity != null)
         {
             hashCode = hashCode * 59 + FreeEventQuantity.GetHashCode();
         }
         return(hashCode);
     }
 }
Example #2
0
        /// <summary>
        /// Returns true if ServiceBundleServiceDetail instances are equal
        /// </summary>
        /// <param name="other">Instance of ServiceBundleServiceDetail to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ServiceBundleServiceDetail other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Code == other.Code ||
                     Code != null &&
                     Code.Equals(other.Code)
                     ) &&
                 (
                     ChargingTriggerInfo == other.ChargingTriggerInfo ||
                     ChargingTriggerInfo != null &&
                     ChargingTriggerInfo.Equals(other.ChargingTriggerInfo)
                 ) &&
                 (
                     EventLimitQuantity == other.EventLimitQuantity ||
                     EventLimitQuantity != null &&
                     EventLimitQuantity.Equals(other.EventLimitQuantity)
                 ) &&
                 (
                     FreeEventQuantity == other.FreeEventQuantity ||
                     FreeEventQuantity != null &&
                     FreeEventQuantity.Equals(other.FreeEventQuantity)
                 ));
        }