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)); }
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)); }