DailyReportService.GetOrGenerateAsync() truncate time of DateTime

This commit is contained in:
ngfrolov 2022-10-04 09:09:35 +05:00
parent 06b7a0da22
commit 44e96e1ad1

View File

@ -48,9 +48,10 @@ namespace AsbCloudInfrastructure.Services.DailyReport
public async Task<DailyReportDto> GetOrGenerateAsync(int idWell, DateTime date, CancellationToken token)
{
var dailyReportDto = await GetAsync(idWell, date, token);
var dateOnly = DateTime.SpecifyKind(date.Date, DateTimeKind.Unspecified);
var dailyReportDto = await GetAsync(idWell, dateOnly, token);
if (dailyReportDto is null)
dailyReportDto = await MakeDefaultDailyReportAsync(idWell, date, token);
dailyReportDto = await MakeDefaultDailyReportAsync(idWell, dateOnly, token);
return dailyReportDto;
}