ISEbd-22 Mavrina J.E. Labwork 4 #5

Closed
Mavrina_Julia wants to merge 7 commits from Лаба_4 into Лаб_3
Showing only changes of commit 645181dc4b - Show all commits

View File

@ -23,9 +23,14 @@ namespace RenovationWorkDatabaseImplement.Implements
public List<OrderViewModel> GetFilteredList(OrderSearchModel model)
{
using var context = new RenovationWorkDatabase();
var result = context.Orders.Include(x => x.Repair).Select(x => x.GetViewModel).ToList();
return result;
}
if (model.DateFrom.HasValue)
{
return context.Orders.Include(x => x.Repair).Where(x => x.DateCreate >= model.DateFrom && x.DateCreate <= model.DateTo).Select(x => x.GetViewModel).ToList();
}
return context.Orders.Include(x => x.Repair).Where(x => x.Id == model.Id).Select(x => x.GetViewModel).ToList();
//var result = context.Orders.Include(x => x.Repair).Select(x => x.GetViewModel).ToList();
// return result;
}
public OrderViewModel? GetElement(OrderSearchModel model)
{