Исправлен апдейт магазина

This commit is contained in:
Данила Мочалов 2023-04-09 16:13:54 +04:00
parent 8956013a65
commit 97736d8dde

View File

@ -79,14 +79,17 @@ namespace LawFirmDatabaseImplement.Implements
using var transaction = context.Database.BeginTransaction();
try
{
var shop = context.Shops.FirstOrDefault(x => x.Id == model.Id);
var shop = context.Shops.Include(x => x.Documents).FirstOrDefault(x => x.Id == model.Id);
if (shop == null)
{
return null;
}
shop.Update(model);
context.SaveChanges();
shop.UpdateDocuments(context, model);
if (model.ShopDocuments.Count > 0)
{
shop.UpdateDocuments(context, model);
}
transaction.Commit();
return shop.GetViewModel;
}