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

            if (!ObjectContext.GetObjectType(GetType()).Equals(ObjectContext.GetObjectType(other.GetType())))
            {
                return(false);
            }

            SingleKeyEntity <T> castedOther = (SingleKeyEntity <T>)other;

            return(!castedOther.IsEmptyKey() && Id.Equals(castedOther.Id));
        }
Пример #2
0
        public override bool Equals(AbstractEntity other)
        {
            if (other == null)
            {
                return(false);
            }

            if (!ObjectContext.GetObjectType(GetType()).Equals(ObjectContext.GetObjectType(other.GetType())))
            {
                return(false);
            }

            DoubleKeyEntity <TKeyA, TKeyB> castedOther = (DoubleKeyEntity <TKeyA, TKeyB>)other;

            return(!castedOther.IsEmptyKey() && KeyA.Equals(castedOther.KeyA) && KeyB.Equals(castedOther.KeyB));
        }