diff --git a/csharp/App/Backend/Model/TreeNode.Equality.cs b/csharp/App/Backend/Model/TreeNode.Equality.cs index e2e374ef4..f37cd51d7 100644 --- a/csharp/App/Backend/Model/TreeNode.Equality.cs +++ b/csharp/App/Backend/Model/TreeNode.Equality.cs @@ -4,9 +4,10 @@ namespace InnovEnergy.App.Backend.Model; public abstract partial class TreeNode { + // Note: Only consider Id, but not ParentId for TreeNode equality checks protected Boolean Equals(TreeNode other) { - return Id == other.Id && ParentId == other.ParentId; + return Id == other.Id; } public override Boolean Equals(Object? obj) @@ -17,8 +18,5 @@ public abstract partial class TreeNode } [SuppressMessage("ReSharper", "NonReadonlyMemberInGetHashCode")] - public override Int32 GetHashCode() - { - return HashCode.Combine(Id, ParentId); - } + public override Int32 GetHashCode() => Id.GetHashCode(); } \ No newline at end of file