Лабораторная_4
This commit is contained in:
parent
83b16975a4
commit
645181dc4b
@ -23,9 +23,14 @@ namespace RenovationWorkDatabaseImplement.Implements
|
|||||||
public List<OrderViewModel> GetFilteredList(OrderSearchModel model)
|
public List<OrderViewModel> GetFilteredList(OrderSearchModel model)
|
||||||
{
|
{
|
||||||
using var context = new RenovationWorkDatabase();
|
using var context = new RenovationWorkDatabase();
|
||||||
var result = context.Orders.Include(x => x.Repair).Select(x => x.GetViewModel).ToList();
|
if (model.DateFrom.HasValue)
|
||||||
return result;
|
{
|
||||||
}
|
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)
|
public OrderViewModel? GetElement(OrderSearchModel model)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user