DD.WellWorkover.Cloud/AsbCloudInfrastructure/Services/TelemetryDataSpinService.cs

33 lines
1.0 KiB
C#
Raw Normal View History

using AsbCloudApp.Data;
using AsbCloudApp.Services;
using AsbCloudDb.Model;
using AsbCloudInfrastructure.Services.Cache;
using Mapster;
namespace AsbCloudInfrastructure.Services
{
2021-11-22 11:30:08 +05:00
public class TelemetryDataSpinService : TelemetryDataBaseService<TelemetryDataSpinDto, TelemetryDataSpin>
{
public TelemetryDataSpinService(
IAsbCloudDbContext db,
ITelemetryService telemetryService,
CacheDb cacheDb)
: base(db, telemetryService, cacheDb)
{ }
public override TelemetryDataSpin Convert(TelemetryDataSpinDto src, double timezoneOffset)
{
var entity = src.Adapt<TelemetryDataSpin>();
entity.Date = src.Date.ToUtcDateTimeOffset(timezoneOffset);
return entity;
}
public override TelemetryDataSpinDto Convert(TelemetryDataSpin src, double timezoneOffset)
{
var dto = src.Adapt<TelemetryDataSpinDto>();
dto.Date = src.Date.ToRemoteDateTime(timezoneOffset);
return dto;
}
}
}