Catel.Data.ModelBase.Equals C# (CSharp) Метод

Equals() публичный Метод

Determines whether the specified System.Object is equal to this instance.
/// The parameter is null. ///
public Equals ( object obj ) : bool
obj object The to compare with this instance.
Результат bool
        public override bool Equals(object obj)
        {
            // Note: at first we only implemented the EqualityComparer, but the IEqualityComparer of Microsoft
            // throws an exception when the 2 types are not the same. Although MS does recommend not to throw exceptions,
            // they do it themselves. Check for null and check the types before feeding it to the equality comparer.

            if (obj == null)
            {
                return false;
            }

            if (GetType() != obj.GetType())
            {
                return false;
            }

            var equalityComparer = EqualityComparer;
            return equalityComparer.Equals(this, obj);
        }