Only consider Id, but not ParentId for TreeNode equality checks
This commit is contained in:
parent
702fa89914
commit
e6fa2933b5
|
@ -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();
|
||||
}
|
Loading…
Reference in New Issue