логикa получения списка фильтрованных заказов

This commit is contained in:
VictoriaPresnyakova 2023-03-20 21:23:35 +04:00
parent 06e21816a4
commit 8bf9fbd296

View File

@ -49,12 +49,9 @@ namespace JewelryStoreFileImplement.Implements
{
if (!model.DateFrom.HasValue || !model.DateTo.HasValue)
{
return source.Orders
.Where(x => x.DateCreate >= model.DateFrom && x.DateCreate <= model.DateTo)
.Select(x => x.GetViewModel)
.ToList();
return new();
}
return source.Orders.Where(x => x.Id == model.Id).Select(x => x.GetViewModel).ToList();
return source.Orders.Where(x => x.DateCreate >= model.DateFrom && x.DateCreate <= model.DateTo).Select(x => x.GetViewModel).ToList();
}
public List<OrderViewModel> GetFullList()