пофиксили

This commit is contained in:
dasha 2023-04-11 16:12:02 +04:00
parent 74f979d1a5
commit 631b3fdb72
4 changed files with 7 additions and 3 deletions

View File

@ -76,6 +76,7 @@ namespace SushiBarDatabaseImplement.Implements
}
shop.Update(model);
context.SaveChanges();
if (model.ListSushi != null)
shop.UpdateSushi(context, model);
transaction.Commit();
return shop.GetViewModel;

View File

@ -80,6 +80,7 @@ namespace SushiBarFileImplement.Models
Address = model.Address;
DateOpening = model.DateOpening;
MaxCountSushi = model.MaxCountSushi;
if (model.ListSushi != null)
CountSushi = model.ListSushi.ToDictionary(x => x.Key, x => x.Value.Item2);
_shopSushi = null;
}

View File

@ -39,6 +39,7 @@ namespace SushiBarListImplement.Models
ShopName = model.ShopName;
Address = model.Address;
DateOpening = model.DateOpening;
if (model.ListSushi != null)
ListSushi = model.ListSushi;
}
public ShopViewModel GetViewModel => new()

View File

@ -72,6 +72,7 @@ namespace SushiBarRestApi.Controllers
{
try
{
model.ListSushi = null!;
_shop.Update(model);
}
catch (Exception ex)