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

This commit is contained in:
Olga Nemt 2024-03-22 17:18:19 +05:00
parent 8ef37600c7
commit 827e1c6694
2 changed files with 4 additions and 4 deletions

View File

@ -15,10 +15,10 @@ public class TrajectoryRequest : RequestBase
/// <summary>
/// Больше или равно дате
/// </summary>
public DateTime? GeDate { get; set; }
public DateTimeOffset? GeDate { get; set; }
/// <summary>
/// Меньше или равно дате
/// </summary>
public DateTime? LeDate { get; set; }
public DateTimeOffset? LeDate { get; set; }
}

View File

@ -38,13 +38,13 @@ namespace AsbCloudInfrastructure.Repository
if (request.GeDate.HasValue)
{
var geDate = request.GeDate.Value.ToUtcDateTimeOffset(timezone.Hours);
var geDate = request.GeDate.Value.ToUniversalTime();
query = query.Where(r => r.DateTime >= geDate);
}
if (request.LeDate.HasValue)
{
var leDate = request.LeDate.Value.ToUtcDateTimeOffset(timezone.Hours);
var leDate = request.LeDate.Value.ToUniversalTime();
query = query.Where(r => r.DateTime <= leDate);
}