DD.WellWorkover.Cloud/AsbCloudApp/Comparators/TelemetryUserDtoComparer.cs
2024-08-19 10:01:07 +05:00

21 lines
553 B
C#

using AsbCloudApp.Data.SAUB;
using System.Collections.Generic;
namespace AsbCloudApp.Comparators;
/// <inheritdoc/>
public class TelemetryUserDtoComparer : IEqualityComparer<TelemetryUserDto>
{
/// <inheritdoc/>
public bool Equals(TelemetryUserDto? prevUser, TelemetryUserDto? nextUser)
{
if (prevUser is not null && nextUser is not null)
return prevUser.Id == nextUser.Id;
return prevUser == nextUser;
}
/// <inheritdoc/>
public int GetHashCode(TelemetryUserDto user) => user.Id.GetHashCode();
}