Пример #1
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj == this)
            {
                return(true);
            }

            return(obj is Invoice other &&
                   ((Id == null && other.Id == null) || (Id?.Equals(other.Id) == true)) &&
                   ((Version == null && other.Version == null) || (Version?.Equals(other.Version) == true)) &&
                   ((LocationId == null && other.LocationId == null) || (LocationId?.Equals(other.LocationId) == true)) &&
                   ((OrderId == null && other.OrderId == null) || (OrderId?.Equals(other.OrderId) == true)) &&
                   ((PrimaryRecipient == null && other.PrimaryRecipient == null) || (PrimaryRecipient?.Equals(other.PrimaryRecipient) == true)) &&
                   ((PaymentRequests == null && other.PaymentRequests == null) || (PaymentRequests?.Equals(other.PaymentRequests) == true)) &&
                   ((DeliveryMethod == null && other.DeliveryMethod == null) || (DeliveryMethod?.Equals(other.DeliveryMethod) == true)) &&
                   ((InvoiceNumber == null && other.InvoiceNumber == null) || (InvoiceNumber?.Equals(other.InvoiceNumber) == true)) &&
                   ((Title == null && other.Title == null) || (Title?.Equals(other.Title) == true)) &&
                   ((Description == null && other.Description == null) || (Description?.Equals(other.Description) == true)) &&
                   ((ScheduledAt == null && other.ScheduledAt == null) || (ScheduledAt?.Equals(other.ScheduledAt) == true)) &&
                   ((PublicUrl == null && other.PublicUrl == null) || (PublicUrl?.Equals(other.PublicUrl) == true)) &&
                   ((NextPaymentAmountMoney == null && other.NextPaymentAmountMoney == null) || (NextPaymentAmountMoney?.Equals(other.NextPaymentAmountMoney) == true)) &&
                   ((Status == null && other.Status == null) || (Status?.Equals(other.Status) == true)) &&
                   ((Timezone == null && other.Timezone == null) || (Timezone?.Equals(other.Timezone) == true)) &&
                   ((CreatedAt == null && other.CreatedAt == null) || (CreatedAt?.Equals(other.CreatedAt) == true)) &&
                   ((UpdatedAt == null && other.UpdatedAt == null) || (UpdatedAt?.Equals(other.UpdatedAt) == true)) &&
                   ((CustomFields == null && other.CustomFields == null) || (CustomFields?.Equals(other.CustomFields) == true)));
        }
Пример #2
0
        /// <summary>
        /// Determines whether the specified Object is equal to the current Object.
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            if (Object.ReferenceEquals(this, obj))
            {
                return(true);
            }
            if (this.GetType() != obj.GetType())
            {
                return(false);
            }


            var other = (VLMessage)obj;

            //reference types
            if (!Object.Equals(Sender, other.Sender))
            {
                return(false);
            }
            if (!Object.Equals(Subject, other.Subject))
            {
                return(false);
            }
            if (!Object.Equals(Body, other.Body))
            {
                return(false);
            }
            if (!Object.Equals(CustomKeyword, other.CustomKeyword))
            {
                return(false);
            }
            if (!Object.Equals(Error, other.Error))
            {
                return(false);
            }
            if (!Object.Equals(SenderVerificationCode, other.SenderVerificationCode))
            {
                return(false);
            }
            //value types
            if (!Collector.Equals(other.Collector))
            {
                return(false);
            }
            if (!MessageId.Equals(other.MessageId))
            {
                return(false);
            }
            if (!Status.Equals(other.Status))
            {
                return(false);
            }
            if (!AttributeFlags.Equals(other.AttributeFlags))
            {
                return(false);
            }
            if (!ScheduledAt.Equals(other.ScheduledAt))
            {
                return(false);
            }
            if (!SentCounter.Equals(other.SentCounter))
            {
                return(false);
            }
            if (!FailedCounter.Equals(other.FailedCounter))
            {
                return(false);
            }
            if (!SkipCounter.Equals(other.SkipCounter))
            {
                return(false);
            }
            if (!DeliveryMethod.Equals(other.DeliveryMethod))
            {
                return(false);
            }
            if (!CustomSearchField.Equals(other.CustomSearchField))
            {
                return(false);
            }
            if (!CustomOperator.Equals(other.CustomOperator))
            {
                return(false);
            }
            if (!PendingAt.Equals(other.PendingAt))
            {
                return(false);
            }
            if (!PreparingAt.Equals(other.PreparingAt))
            {
                return(false);
            }
            if (!PreparedAt.Equals(other.PreparedAt))
            {
                return(false);
            }
            if (!ExecutingAt.Equals(other.ExecutingAt))
            {
                return(false);
            }
            if (!TerminatedAt.Equals(other.TerminatedAt))
            {
                return(false);
            }

            return(true);
        }