.
This commit is contained in:
parent
17138020cd
commit
bdb15b04aa
@ -85,6 +85,8 @@ namespace IceCreamShopDatabaseImplement.Models
|
|||||||
public void UpdateIceCreams(IceCreamShopDataBase context,
|
public void UpdateIceCreams(IceCreamShopDataBase context,
|
||||||
ShopBindingModel model)
|
ShopBindingModel model)
|
||||||
{
|
{
|
||||||
|
if (model.ShopIceCreams == null)
|
||||||
|
return;
|
||||||
var shopIceCreams = context.ShopIceCreams.Where(rec =>
|
var shopIceCreams = context.ShopIceCreams.Where(rec =>
|
||||||
rec.ShopId == model.Id).ToList();
|
rec.ShopId == model.Id).ToList();
|
||||||
if (shopIceCreams != null && shopIceCreams.Count > 0)
|
if (shopIceCreams != null && shopIceCreams.Count > 0)
|
||||||
|
@ -68,6 +68,7 @@ namespace IceCreamShopRestApi.Controllers
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
model.ShopIceCreams = null!;
|
||||||
return _logic.Update(model);
|
return _logic.Update(model);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user