Innovenergy_trunk/csharp/App/Backend/Model/TreeNode.Equality.cs

24 lines
643 B
C#
Raw Normal View History

2023-02-24 12:59:56 +00:00
using System.Diagnostics.CodeAnalysis;
namespace Innovenergy.Backend.Model;
public abstract partial class TreeNode
{
protected Boolean Equals(TreeNode other)
{
return Id == other.Id && ParentId == other.ParentId;
}
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")]
public override Int32 GetHashCode()
{
return HashCode.Combine(Id, ParentId);
}
}