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

20 lines
554 B
C#
Raw Normal View History

2023-02-16 12:57:06 +00:00
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());
}
}