пофиксили
This commit is contained in:
parent
74f979d1a5
commit
631b3fdb72
@ -76,7 +76,8 @@ namespace SushiBarDatabaseImplement.Implements
|
|||||||
}
|
}
|
||||||
shop.Update(model);
|
shop.Update(model);
|
||||||
context.SaveChanges();
|
context.SaveChanges();
|
||||||
shop.UpdateSushi(context, model);
|
if (model.ListSushi != null)
|
||||||
|
shop.UpdateSushi(context, model);
|
||||||
transaction.Commit();
|
transaction.Commit();
|
||||||
return shop.GetViewModel;
|
return shop.GetViewModel;
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,8 @@ namespace SushiBarFileImplement.Models
|
|||||||
Address = model.Address;
|
Address = model.Address;
|
||||||
DateOpening = model.DateOpening;
|
DateOpening = model.DateOpening;
|
||||||
MaxCountSushi = model.MaxCountSushi;
|
MaxCountSushi = model.MaxCountSushi;
|
||||||
CountSushi = model.ListSushi.ToDictionary(x => x.Key, x => x.Value.Item2);
|
if (model.ListSushi != null)
|
||||||
|
CountSushi = model.ListSushi.ToDictionary(x => x.Key, x => x.Value.Item2);
|
||||||
_shopSushi = null;
|
_shopSushi = null;
|
||||||
}
|
}
|
||||||
public ShopViewModel GetViewModel => new()
|
public ShopViewModel GetViewModel => new()
|
||||||
|
@ -39,7 +39,8 @@ namespace SushiBarListImplement.Models
|
|||||||
ShopName = model.ShopName;
|
ShopName = model.ShopName;
|
||||||
Address = model.Address;
|
Address = model.Address;
|
||||||
DateOpening = model.DateOpening;
|
DateOpening = model.DateOpening;
|
||||||
ListSushi = model.ListSushi;
|
if (model.ListSushi != null)
|
||||||
|
ListSushi = model.ListSushi;
|
||||||
}
|
}
|
||||||
public ShopViewModel GetViewModel => new()
|
public ShopViewModel GetViewModel => new()
|
||||||
{
|
{
|
||||||
|
@ -72,6 +72,7 @@ namespace SushiBarRestApi.Controllers
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
model.ListSushi = null!;
|
||||||
_shop.Update(model);
|
_shop.Update(model);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
Loading…
Reference in New Issue
Block a user