API. Расписание для хоста в общем формате

This commit is contained in:
Mikhail Kuznetsov
2023-06-21 12:28:16 +10:00
parent 3ebc077b27
commit e55d8b8641
13 changed files with 199 additions and 761 deletions

View File

@@ -24,17 +24,17 @@ namespace PARR.DAL.Services.Implementations
public async Task<JobJournal?> GetLastAsync(Guid jobId, Guid hostId, DateTimeOffset date)
{
var n=DateTimeOffset.UtcNow;
var opers = await EntitySet
.Where(j => j.JobId == jobId && j.HostId == hostId && (j.DateOper.AddTicks(0-j.DateOper.UtcTicks) <= n))/*date.StartOfDay()*/// && j.DateOper < date.EndOfDay()))
.OrderBy(t => t.DateOper)
.LastOrDefaultAsync();
//var n=DateTimeOffset.UtcNow;
//var opers = await EntitySet
// .Where(j => j.JobId == jobId && j.HostId == hostId && j.DateOper.DateTime.Date == date.DateTime.Date)
// .Where(j => j.JobId == jobId && j.HostId == hostId && (j.DateOper!=DateTimeOffset.MinValue))/*date.StartOfDay()*/// && j.DateOper < date.EndOfDay()))
// .OrderBy(t => t.DateOper)
// .LastOrDefaultAsync();
var opers = await EntitySet
.Where(j => j.JobId == jobId && j.HostId == hostId && j.DateOper.DateTime.Date == date.DateTime.Date)
.OrderBy(t => t.DateOper)
.LastOrDefaultAsync();
return opers;
}
}