forked from ddrilling/AsbCloudServer
bbab9e1a15
Семафор на добавление тега теперь работает существенно быстрее, логика заполнения данными из БД перенесена под семафор конкретного кеша.
44 lines
1.2 KiB
C#
44 lines
1.2 KiB
C#
namespace AsbCloudApp.Data
|
|
{
|
|
/// <summary>
|
|
/// âðåìåííàÿ çîíà
|
|
/// </summary>
|
|
public class SimpleTimezoneDto
|
|
{
|
|
/// <summary>
|
|
/// ñìåùåíèå â ÷àñàõ îòíîñèòåëüíî UTC
|
|
/// </summary>
|
|
public double Hours { get; set; }
|
|
|
|
/// <summary>
|
|
/// èäåíòèôèêàòîð ÷àñîâîé çîíû
|
|
/// </summary>
|
|
public string TimezoneId { get; set; }
|
|
|
|
/// <summary>
|
|
/// çàïðåò íà ïåðåîïðåäåëåíèå
|
|
/// </summary>
|
|
public bool IsOverride { get; set; }
|
|
|
|
/// <inheritdoc/>
|
|
public override bool Equals(object obj)
|
|
{
|
|
if (obj is SimpleTimezoneDto tTimeZone
|
|
&& tTimeZone.Hours == Hours
|
|
&& tTimeZone.TimezoneId == TimezoneId
|
|
&& tTimeZone.IsOverride == IsOverride)
|
|
return true;
|
|
return false;
|
|
}
|
|
|
|
/// <inheritdoc/>
|
|
public override int GetHashCode()
|
|
=> Hours.GetHashCode()
|
|
| TimezoneId.GetHashCode()
|
|
| IsOverride.GetHashCode();
|
|
|
|
/// <inheritdoc/>
|
|
public override string ToString()
|
|
=> $"{TimezoneId} (UTC+{Hours:00.##})";
|
|
}
|
|
} |