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

20 lines
554 B
C#

using InnovEnergy.Lib.Utils;
namespace InnovEnergy.API.DataModel;
public abstract partial record UserParent
{
public virtual Boolean Equals(UserParent? other)
{
if (ReferenceEquals(null, other)) return false;
if (ReferenceEquals(this, other)) return true;
return base.Equals(other) && Users.SequenceEqual(other.Users);
}
public override Int32 GetHashCode()
{
// ReSharper disable once NonReadonlyMemberInGetHashCode
return HashCode.Combine(base.GetHashCode(), Users.SequenceHash());
}
}