Пример #1
0
        public override int GetHashCode()
        {
            int result = 7;

            result = 7 * result + Id.GetHashCode();
            result = 7 * result + Type.GetHashCode();
            result = 7 * result + BdioExternalIdentifier.GetHashCode();
            result = 7 * result + Relationships.GetHashCode();
            return(result);
        }
Пример #2
0
        public override bool Equals(object obj)
        {
            var other = obj as BdioNode;

            if (other == null)
            {
                return(false);
            }
            bool id   = Id == other.Id;
            bool type = Type == other.Type;
            bool bdioExternalIdentifer = (BdioExternalIdentifier == other.BdioExternalIdentifier) || BdioExternalIdentifier.Equals(other.BdioExternalIdentifier);
            bool relationships         = Relationships.Count == other.Relationships.Count;

            foreach (BdioRelationship relationship in other.Relationships)
            {
                if (!Relationships.Contains(relationship))
                {
                    relationships = false;
                    break;
                }
            }
            return(id && type && bdioExternalIdentifer && relationships);
        }