2023-02-24 12:59:56 +00:00
|
|
|
using System.Diagnostics.CodeAnalysis;
|
|
|
|
|
2023-03-08 12:20:33 +00:00
|
|
|
namespace InnovEnergy.App.Backend.Model;
|
2023-02-24 12:59:56 +00:00
|
|
|
|
|
|
|
public abstract partial class TreeNode
|
|
|
|
{
|
2023-03-08 12:28:22 +00:00
|
|
|
// Note: Only consider Id, but not ParentId for TreeNode equality checks
|
2023-02-24 12:59:56 +00:00
|
|
|
protected Boolean Equals(TreeNode other)
|
|
|
|
{
|
2023-03-08 12:28:22 +00:00
|
|
|
return Id == other.Id;
|
2023-02-24 12:59:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public override Boolean Equals(Object? obj)
|
|
|
|
{
|
|
|
|
if (ReferenceEquals(null, obj)) return false;
|
|
|
|
if (ReferenceEquals(this, obj)) return true;
|
|
|
|
return obj.GetType() == GetType() && Equals((TreeNode)obj);
|
|
|
|
}
|
|
|
|
|
|
|
|
[SuppressMessage("ReSharper", "NonReadonlyMemberInGetHashCode")]
|
2023-03-08 12:28:22 +00:00
|
|
|
public override Int32 GetHashCode() => Id.GetHashCode();
|
2023-02-24 12:59:56 +00:00
|
|
|
}
|