Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
suxrobGM committed Dec 9, 2023
1 parent d26e188 commit db9d0b2
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ public GetLoadsHandler(ITenantUnityOfWork tenantUow)
{
baseQuery = baseQuery.Where(i => i.AssignedTruckId == req.TruckId);
}
if (req.StartDate.HasValue && req.EndDate.HasValue)
if (req is { StartDate: not null, EndDate: not null })
{
baseQuery = baseQuery.Where(i => i.DispatchedDate >= req.StartDate &&
i.DispatchedDate <= req.EndDate);
}
if (!req.LoadAllPages)
{
baseQuery = baseQuery.Skip((req.Page - 1) * req.PageSize).Take(req.PageSize);
baseQuery = baseQuery.ApplyPaging(req.Page, req.PageSize);
}

var loads = baseQuery.Select(i => i.ToDto()).ToArray();
Expand Down

0 comments on commit db9d0b2

Please sign in to comment.