Beispiel #1
0
        public virtual bool Equals(IUnique <T> other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            if (IsEntityPersistent(this) && IsEntityPersistent(other) && Equals(other.Id, Id))
            {
                var otherType = other.GetEntityType();
                var thisType  = GetEntityType();

                return(thisType.IsAssignableFrom(otherType) || otherType.IsAssignableFrom(thisType));
            }

            return(false);
        }
Beispiel #2
0
        public virtual bool Equals(IUnique <T> other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            if (HasOidAssigned && other.HasOidAssigned && Oid.Equals(other.Oid))
            {
                var otherType = other.GetEntityType();
                var thisType  = GetEntityType();

                return(thisType.IsAssignableFrom(otherType) || otherType.IsAssignableFrom(thisType));
            }

            return(false);
        }