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

23 lines
691 B
C#

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