Exemple #1
0
        public override int GetHashCode()
        {
            int hashCode = -823121408;

            if (Id != null)
            {
                hashCode += Id.GetHashCode();
            }

            if (Mappings != null)
            {
                hashCode += Mappings.GetHashCode();
            }

            if (ProgramId != null)
            {
                hashCode += ProgramId.GetHashCode();
            }

            if (Balance != null)
            {
                hashCode += Balance.GetHashCode();
            }

            if (LifetimePoints != null)
            {
                hashCode += LifetimePoints.GetHashCode();
            }

            if (CustomerId != null)
            {
                hashCode += CustomerId.GetHashCode();
            }

            if (EnrolledAt != null)
            {
                hashCode += EnrolledAt.GetHashCode();
            }

            if (CreatedAt != null)
            {
                hashCode += CreatedAt.GetHashCode();
            }

            if (UpdatedAt != null)
            {
                hashCode += UpdatedAt.GetHashCode();
            }

            return(hashCode);
        }
Exemple #2
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

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

            return(obj is LoyaltyAccount other &&
                   ((Id == null && other.Id == null) || (Id?.Equals(other.Id) == true)) &&
                   ((Mappings == null && other.Mappings == null) || (Mappings?.Equals(other.Mappings) == true)) &&
                   ((ProgramId == null && other.ProgramId == null) || (ProgramId?.Equals(other.ProgramId) == true)) &&
                   ((Balance == null && other.Balance == null) || (Balance?.Equals(other.Balance) == true)) &&
                   ((LifetimePoints == null && other.LifetimePoints == null) || (LifetimePoints?.Equals(other.LifetimePoints) == true)) &&
                   ((CustomerId == null && other.CustomerId == null) || (CustomerId?.Equals(other.CustomerId) == true)) &&
                   ((EnrolledAt == null && other.EnrolledAt == null) || (EnrolledAt?.Equals(other.EnrolledAt) == true)) &&
                   ((CreatedAt == null && other.CreatedAt == null) || (CreatedAt?.Equals(other.CreatedAt) == true)) &&
                   ((UpdatedAt == null && other.UpdatedAt == null) || (UpdatedAt?.Equals(other.UpdatedAt) == true)));
        }