исправления ошибок.

This commit is contained in:
Павел Сорокин 2023-03-14 09:10:07 +04:00
parent 0691d3f44f
commit 5a09463d31

View File

@ -9,6 +9,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace ShipyardFileImplement.Implements
{
@ -75,13 +76,13 @@ namespace ShipyardFileImplement.Implements
public ShopViewModel? Delete(ShopBindingModel model)
{
var shop = source.Shops.FirstOrDefault(x => x.Id == model.Id);
if (shop == null)
if (shop != null)
{
return null;
source.Shops.Remove(shop);
source.SaveShops();
return shop.GetViewModel;
}
shop.Update(model);
source.SaveShops();
return shop.GetViewModel;
return null;
}
public bool SellShips(IShipModel model, int count)
{