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

24 lines
647 B
C#

using System.Diagnostics.CodeAnalysis;
namespace InnovEnergy.App.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);
}
}