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