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