Изменение типа даты в FileRequest и FileRepository

This commit is contained in:
Olga Nemt 2024-03-20 17:34:03 +05:00
parent ec2abd224e
commit 2ae1cd2e3d
2 changed files with 4 additions and 4 deletions

View File

@ -33,12 +33,12 @@ namespace AsbCloudApp.Requests
/// <summary>
/// Дата начала периода
/// </summary>
public DateTime? Begin { get; set; }
public DateTimeOffset? Begin { get; set; }
/// <summary>
/// Дата окончания периода
/// </summary>
public DateTime? End { get; set; }
public DateTimeOffset? End { get; set; }
/// <summary>
/// Признак удаления

View File

@ -53,13 +53,13 @@ namespace AsbCloudInfrastructure.Repository
if (request.Begin is not null)
{
var beginUtc = request.Begin.Value.ToUtcDateTimeOffset(timezoneOffsetHours);
var beginUtc = request.Begin.Value.ToUniversalTime();
query = query.Where(e => e.UploadDate >= beginUtc);
}
if (request.End is not null)
{
var endUtc = request.End.Value.ToUtcDateTimeOffset(timezoneOffsetHours);
var endUtc = request.End.Value.ToUniversalTime();
query = query.Where(e => e.UploadDate <= endUtc);
}