コード例 #1
0
ファイル: Unique.cs プロジェクト: Sony-NS/SharpMap
        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);
        }