ПИбд-22 Боровков М В 5 лабораторная работа #6
@ -24,8 +24,7 @@ namespace SushiBarDatabaseImplement.Implements
|
|||||||
return context.Orders
|
return context.Orders
|
||||||
.Include(o => o.Sushi)
|
.Include(o => o.Sushi)
|
||||||
.Where(o =>
|
.Where(o =>
|
||||||
(model.Id.HasValue && o.Id == model.Id) ||
|
(model.Id.HasValue && o.Id == model.Id))
|
||||||
(model.DateFrom.HasValue && model.DateTo.HasValue && model.DateFrom < o.DateCreate && o.DateCreate < model.DateTo))
|
|
||||||
.Select(o => o.GetViewModel)
|
.Select(o => o.GetViewModel)
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
@ -79,6 +78,7 @@ namespace SushiBarDatabaseImplement.Implements
|
|||||||
{
|
{
|
||||||
using var context = new SushiBarDatabase();
|
using var context = new SushiBarDatabase();
|
||||||
var element = context.Orders
|
var element = context.Orders
|
||||||
|
.Include(o => o.Sushi)
|
||||||
.FirstOrDefault(o => o.Id == model.Id);
|
.FirstOrDefault(o => o.Id == model.Id);
|
||||||
if (element != null)
|
if (element != null)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user