Пример #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 (ProductId != null)
         {
             hashCode = hashCode * 59 + ProductId.GetHashCode();
         }
         if (EffectiveFrom != null)
         {
             hashCode = hashCode * 59 + EffectiveFrom.GetHashCode();
         }
         if (EffectiveTo != null)
         {
             hashCode = hashCode * 59 + EffectiveTo.GetHashCode();
         }
         if (LastUpdated != null)
         {
             hashCode = hashCode * 59 + LastUpdated.GetHashCode();
         }
         if (ProductCategory != null)
         {
             hashCode = hashCode * 59 + ProductCategory.GetHashCode();
         }
         if (Name != null)
         {
             hashCode = hashCode * 59 + Name.GetHashCode();
         }
         if (Description != null)
         {
             hashCode = hashCode * 59 + Description.GetHashCode();
         }
         if (Brand != null)
         {
             hashCode = hashCode * 59 + Brand.GetHashCode();
         }
         if (BrandName != null)
         {
             hashCode = hashCode * 59 + BrandName.GetHashCode();
         }
         if (ApplicationUri != null)
         {
             hashCode = hashCode * 59 + ApplicationUri.GetHashCode();
         }
         if (IsTailored != null)
         {
             hashCode = hashCode * 59 + IsTailored.GetHashCode();
         }
         if (AdditionalInformation != null)
         {
             hashCode = hashCode * 59 + AdditionalInformation.GetHashCode();
         }
         return(hashCode);
     }
 }
Пример #2
0
        /// <summary>
        /// Returns true if BankingProduct instances are equal
        /// </summary>
        /// <param name="other">Instance of BankingProduct to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(BankingProduct other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     ProductId == other.ProductId ||
                     ProductId != null &&
                     ProductId.Equals(other.ProductId)
                     ) &&
                 (
                     EffectiveFrom == other.EffectiveFrom ||
                     EffectiveFrom != null &&
                     EffectiveFrom.Equals(other.EffectiveFrom)
                 ) &&
                 (
                     EffectiveTo == other.EffectiveTo ||
                     EffectiveTo != null &&
                     EffectiveTo.Equals(other.EffectiveTo)
                 ) &&
                 (
                     LastUpdated == other.LastUpdated ||
                     LastUpdated != null &&
                     LastUpdated.Equals(other.LastUpdated)
                 ) &&
                 (
                     ProductCategory == other.ProductCategory ||
                     ProductCategory != null &&
                     ProductCategory.Equals(other.ProductCategory)
                 ) &&
                 (
                     Name == other.Name ||
                     Name != null &&
                     Name.Equals(other.Name)
                 ) &&
                 (
                     Description == other.Description ||
                     Description != null &&
                     Description.Equals(other.Description)
                 ) &&
                 (
                     Brand == other.Brand ||
                     Brand != null &&
                     Brand.Equals(other.Brand)
                 ) &&
                 (
                     BrandName == other.BrandName ||
                     BrandName != null &&
                     BrandName.Equals(other.BrandName)
                 ) &&
                 (
                     ApplicationUri == other.ApplicationUri ||
                     ApplicationUri != null &&
                     ApplicationUri.Equals(other.ApplicationUri)
                 ) &&
                 (
                     IsTailored == other.IsTailored ||
                     IsTailored != null &&
                     IsTailored.Equals(other.IsTailored)
                 ) &&
                 (
                     AdditionalInformation == other.AdditionalInformation ||
                     AdditionalInformation != null &&
                     AdditionalInformation.Equals(other.AdditionalInformation)
                 ));
        }