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

23 lines
691 B
C#
Raw Normal View History

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