Beispiel #1
0
        public override bool Equals(object obj)
        {
            if (obj == null || obj.GetType() != GetType())
            {
                return(false);
            }

            BaseValueObject      other       = (BaseValueObject)obj;
            IEnumerator <object> thisValues  = GetAtomicValues().GetEnumerator();
            IEnumerator <object> otherValues = other.GetAtomicValues().GetEnumerator();

            while (thisValues.MoveNext() && otherValues.MoveNext())
            {
                if (thisValues.Current is null ^ otherValues.Current is null)
                {
                    return(false);
                }

                if (thisValues.Current?.Equals(otherValues.Current) == false)
                {
                    return(false);
                }
            }
            return(!thisValues.MoveNext() && !otherValues.MoveNext());
        }
Beispiel #2
0
 protected static bool EqualOperator(BaseValueObject left, BaseValueObject right)
 {
     if (left is null ^ right is null)
     {
         return(false);
     }
     return(left?.Equals(right) != false);
 }
Beispiel #3
0
 protected static bool NotEqualOperator(BaseValueObject left, BaseValueObject right)
 {
     return(!EqualOperator(left, right));
 }