Смена типа дат для MessageRequestBase

This commit is contained in:
Olga Nemt 2024-03-21 13:58:28 +05:00
parent ef9466f90d
commit 0bbbb43802
2 changed files with 4 additions and 4 deletions

View File

@ -17,12 +17,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

@ -72,13 +72,13 @@ namespace AsbCloudInfrastructure.Services.SAUB
if (request.Begin is not null)
{
var beginUtc = request.Begin.Value.ToUtcDateTimeOffset(timezone.Hours);
var beginUtc = request.Begin.Value.ToUniversalTime();
query = query.Where(m => m.DateTime >= beginUtc);
}
if (request.End is not null)
{
var endUtc = request.End.Value.ToUtcDateTimeOffset(timezone.Hours);
var endUtc = request.End.Value.ToUniversalTime();
query = query.Where(m => m.DateTime <= endUtc);
}