示例#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);
        }
示例#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);
        }