Пример #1
0
        public override bool Equals(object obj)
        {
            if (!(obj is Account other))
            {
                return(false);
            }

            return(ReferenceEquals(this, other) ||
                   (Id == other.Id &&
                    (LastMonthlyPaymentDate == null || LastMonthlyPaymentDate.Equals(other.LastMonthlyPaymentDate)) &&
                    PersonId == other.PersonId &&
                    MonthlyPaymentAmount == other.MonthlyPaymentAmount &&
                    (Donations ?? new List <Donation>()).SequenceEqual(other.Donations ?? new List <Donation>())));
        }
Пример #2
0
        public override bool Equals(object obj)
        {
            var other = obj as Account;

            if (ReferenceEquals(null, other))
            {
                return(false);
            }

            return(ReferenceEquals(this, other) ||
                   (ID == other.ID &&
                    (LastMonthlyPaymentDate == null || LastMonthlyPaymentDate.Equals(other.LastMonthlyPaymentDate)) &&
                    PersonID == other.PersonID &&
                    MonthlyPaymentAmount == other.MonthlyPaymentAmount &&
                    Enumerable.SequenceEqual(Donations ?? new List <Donation>(), other.Donations ?? new List <Donation>())));
        }