DD.WellWorkover.Cloud/AsbCloudApp/Comparators/TelemetryUserDtoComparer.cs

21 lines
553 B
C#
Raw Normal View History

using AsbCloudApp.Data.SAUB;
using System.Collections.Generic;
2024-08-19 10:01:07 +05:00
namespace AsbCloudApp.Comparators;
/// <inheritdoc/>
public class TelemetryUserDtoComparer : IEqualityComparer<TelemetryUserDto>
{
2022-06-01 17:52:26 +05:00
/// <inheritdoc/>
2024-08-19 10:01:07 +05:00
public bool Equals(TelemetryUserDto? prevUser, TelemetryUserDto? nextUser)
{
2024-08-19 10:01:07 +05:00
if (prevUser is not null && nextUser is not null)
return prevUser.Id == nextUser.Id;
2024-08-19 10:01:07 +05:00
return prevUser == nextUser;
}
2024-08-19 10:01:07 +05:00
/// <inheritdoc/>
public int GetHashCode(TelemetryUserDto user) => user.Id.GetHashCode();
}