forked from ddrilling/AsbCloudServer
21 lines
553 B
C#
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();
|
|
}
|