Innovenergy_trunk/csharp/app/API/DataModel/Installation.Equality.cs

24 lines
714 B
C#

using System.Diagnostics.CodeAnalysis;
using InnovEnergy.Lib.Utils;
namespace InnovEnergy.API.DataModel;
public abstract partial record Installation
{
public virtual Boolean Equals(Installation? other)
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) return true;
return base.Equals(other) &&
VpnIp == other.VpnIp &&
IeSerial == other.IeSerial &&
Tags.SequenceEqual(other.Tags);
}
[SuppressMessage("ReSharper", "NonReadonlyMemberInGetHashCode")]
public override Int32 GetHashCode()
{
return HashCode.Combine(base.GetHashCode(), VpnIp, IeSerial, Tags.SequenceHash());
}
}