почему то не работает
This commit is contained in:
parent
c5f9bc34c3
commit
2c2eec51ff
@ -89,9 +89,12 @@ namespace IceCreamShopDatabaseImplement.Models
|
||||
if (iceCreams != null && iceCreams.Count > 0)
|
||||
{
|
||||
// удалили те, которых нет в модели
|
||||
context.ShopIcecreams.RemoveRange(iceCreams.Where(rec => !model.ShopIceCreams.ContainsKey(rec.IceCreamId)));
|
||||
context.SaveChanges();
|
||||
iceCreams = context.ShopIcecreams.Where(rec => rec.ShopId == model.Id).ToList();
|
||||
if (shopIcecreams != null && shopIcecreams.Count > 0)
|
||||
{
|
||||
context.ShopIcecreams
|
||||
.RemoveRange(shopIcecreams
|
||||
.Where(rec => !model.ShopIceCreams
|
||||
.ContainsKey(rec.IceCreamId)));
|
||||
// обновили количество у существующих записей
|
||||
foreach (var updateIceCream in iceCreams)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user