Небольшой фикс

This commit is contained in:
Павел Сорокин 2023-03-19 18:56:57 +04:00
parent 08e7ecf217
commit ff1c673e33

View File

@ -77,7 +77,7 @@ namespace ShipyardDataBaseImplement.Models
public void UpdateShips(ShipyardDataBase context, ShopBindingModel model)
{
var shopShips = context.ShopShips.Where(rec => rec.ShipId == model.Id).ToList();
var shopShips = context.ShopShips.Where(rec => rec.ShopId == model.Id).ToList();
if (shopShips != null && shopShips.Count > 0)
{
context.ShopShips.RemoveRange(shopShips.Where(rec => !model.ShopShips.ContainsKey(rec.ShipId)));