public override bool Equals(object obj) { if (obj == null) { return(false); } if (obj == this) { return(true); } return(obj is OrderLineItemDiscount other && ((Uid == null && other.Uid == null) || (Uid?.Equals(other.Uid) == true)) && ((CatalogObjectId == null && other.CatalogObjectId == null) || (CatalogObjectId?.Equals(other.CatalogObjectId) == true)) && ((Name == null && other.Name == null) || (Name?.Equals(other.Name) == true)) && ((Type == null && other.Type == null) || (Type?.Equals(other.Type) == true)) && ((Percentage == null && other.Percentage == null) || (Percentage?.Equals(other.Percentage) == true)) && ((AmountMoney == null && other.AmountMoney == null) || (AmountMoney?.Equals(other.AmountMoney) == true)) && ((AppliedMoney == null && other.AppliedMoney == null) || (AppliedMoney?.Equals(other.AppliedMoney) == true)) && ((Metadata == null && other.Metadata == null) || (Metadata?.Equals(other.Metadata) == true)) && ((Scope == null && other.Scope == null) || (Scope?.Equals(other.Scope) == true)) && ((RewardIds == null && other.RewardIds == null) || (RewardIds?.Equals(other.RewardIds) == true)) && ((PricingRuleId == null && other.PricingRuleId == null) || (PricingRuleId?.Equals(other.PricingRuleId) == true))); }
public override int GetHashCode() { int hashCode = 1963841269; if (Uid != null) { hashCode += Uid.GetHashCode(); } if (CatalogObjectId != null) { hashCode += CatalogObjectId.GetHashCode(); } if (Name != null) { hashCode += Name.GetHashCode(); } if (Type != null) { hashCode += Type.GetHashCode(); } if (Percentage != null) { hashCode += Percentage.GetHashCode(); } if (AmountMoney != null) { hashCode += AmountMoney.GetHashCode(); } if (AppliedMoney != null) { hashCode += AppliedMoney.GetHashCode(); } if (Metadata != null) { hashCode += Metadata.GetHashCode(); } if (Scope != null) { hashCode += Scope.GetHashCode(); } if (RewardIds != null) { hashCode += RewardIds.GetHashCode(); } if (PricingRuleId != null) { hashCode += PricingRuleId.GetHashCode(); } return(hashCode); }