Fixed date intervals in .GetOperationsSummaryAsync()

This commit is contained in:
KharchenkoVV 2021-09-10 11:30:24 +05:00
parent b022a4c1cb
commit 4b8a161ed5

View File

@ -161,8 +161,12 @@ namespace AsbCloudInfrastructure.Services
if (telemetryId is null)
return null;
var unixBegin = (begin - new DateTime(1970, 1, 1)).TotalSeconds;
var unixEnd = (end - new DateTime(1970, 1, 1)).TotalSeconds;
var unixBegin = begin == default
? 0
: (begin - new DateTime(1970, 1, 1)).TotalSeconds;
var unixEnd = end == default
? (DateTime.Now - new DateTime(1970, 1, 1)).TotalSeconds
: (end - new DateTime(1970, 1, 1)).TotalSeconds;
return await (from a in db.TelemetryAnalysis
where a.IdTelemetry == telemetryId &&