database implements layers
This commit is contained in:
parent
b3db89edd4
commit
f41a3493b1
@ -22,7 +22,12 @@ namespace PizzeriaDatabaseImplement.Implements
|
|||||||
{
|
{
|
||||||
using var context = new PizzeriaDatabase();
|
using var context = new PizzeriaDatabase();
|
||||||
return context.Orders
|
return context.Orders
|
||||||
.Where(x => (model.Id.HasValue && x.Id == model.Id))
|
.Where(x => (
|
||||||
|
(!model.Id.HasValue || x.Id == model.Id) &&
|
||||||
|
(!model.DateFrom.HasValue || x.DateCreate >= model.DateFrom) &&
|
||||||
|
(!model.DateTo.HasValue || x.DateCreate <= model.DateTo)
|
||||||
|
)
|
||||||
|
)
|
||||||
.Select(x => x.GetViewModel)
|
.Select(x => x.GetViewModel)
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user