ПИбд-23 Салин Олег Алексеевич Лабораторная работа №5 (Усложненная) #20
@ -85,6 +85,8 @@ namespace IceCreamShopDatabaseImplement.Models
|
||||
public void UpdateIceCreams(IceCreamShopDataBase context,
|
||||
ShopBindingModel model)
|
||||
{
|
||||
if (model.ShopIceCreams == null)
|
||||
return;
|
||||
var shopIceCreams = context.ShopIceCreams.Where(rec =>
|
||||
rec.ShopId == model.Id).ToList();
|
||||
if (shopIceCreams != null && shopIceCreams.Count > 0)
|
||||
|
@ -68,6 +68,7 @@ namespace IceCreamShopRestApi.Controllers
|
||||
{
|
||||
try
|
||||
{
|
||||
model.ShopIceCreams = null!;
|
||||
return _logic.Update(model);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
Loading…
Reference in New Issue
Block a user