Исправление финального OrderStorage (надеюсь, что там всё нормально теперь везде).
This commit is contained in:
parent
47c32113a7
commit
1ca9dcf5c6
@ -19,6 +19,8 @@ namespace BlacksmithWorkshopDatabaseImplement.Implements
|
||||
using var context = new BlacksmithWorkshopDatabase();
|
||||
|
||||
var element = context.Orders
|
||||
.Include(x => x.Manufacture)
|
||||
.Include(x => x.Client)
|
||||
.FirstOrDefault(rec => rec.Id == model.Id);
|
||||
|
||||
if (element != null)
|
||||
@ -26,6 +28,7 @@ namespace BlacksmithWorkshopDatabaseImplement.Implements
|
||||
// для отображения КОРРЕКТНОЙ ViewModel-и
|
||||
var deletedElement = context.Orders
|
||||
.Include(x => x.Manufacture)
|
||||
.Include(x => x.Client)
|
||||
.FirstOrDefault(x => x.Id == model.Id)
|
||||
?.GetViewModel;
|
||||
|
||||
@ -129,7 +132,10 @@ namespace BlacksmithWorkshopDatabaseImplement.Implements
|
||||
public OrderViewModel? Update(OrderBindingModel model)
|
||||
{
|
||||
using var context = new BlacksmithWorkshopDatabase();
|
||||
var order = context.Orders.FirstOrDefault(x => x.Id == model.Id);
|
||||
var order = context.Orders
|
||||
.Include(x => x.Manufacture)
|
||||
.Include(x => x.Client)
|
||||
.FirstOrDefault(x => x.Id == model.Id);
|
||||
|
||||
if (order == null)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user