ISEbd-22 Mavrina J.E. Labwork 4 #5
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user