diff --git a/SushiBar/SushiBarContracts/StoragesContracts/IShopStorage.cs b/SushiBar/SushiBarContracts/StoragesContracts/IShopStorage.cs index 0028fe5..d2b3b6e 100644 --- a/SushiBar/SushiBarContracts/StoragesContracts/IShopStorage.cs +++ b/SushiBar/SushiBarContracts/StoragesContracts/IShopStorage.cs @@ -13,7 +13,6 @@ namespace SushiBarContracts.StoragesContracts ShopViewModel? Insert(ShopBindingModel model); ShopViewModel? Update(ShopBindingModel model); ShopViewModel? Delete(ShopBindingModel model); - bool IsEnoughSushi(ISushiModel model, int count); bool SellSushi(ISushiModel model, int count); } } diff --git a/SushiBar/SushiBarFileImplement/Implements/ShopStorage.cs b/SushiBar/SushiBarFileImplement/Implements/ShopStorage.cs index d8d5302..18ecd1d 100644 --- a/SushiBar/SushiBarFileImplement/Implements/ShopStorage.cs +++ b/SushiBar/SushiBarFileImplement/Implements/ShopStorage.cs @@ -72,16 +72,9 @@ namespace SushiBarFileImplement.Implements return null; } - public bool IsEnoughSushi(ISushiModel model, int count) - { - int temp = source.Shops - .Select(x => x.ListSushi.FirstOrDefault(y => y.Key == model.Id).Value.Item2).Sum(); - return temp >= count; - } - public bool SellSushi(ISushiModel model, int count) { - if (!IsEnoughSushi(model, count)) + if (source.Shops.Select(x => x.ListSushi.FirstOrDefault(y => y.Key == model.Id).Value.Item2).Sum() < count) { return false; } diff --git a/SushiBar/SushiBarListImplement/Implements/ShopStorage.cs b/SushiBar/SushiBarListImplement/Implements/ShopStorage.cs index f7c55c9..1f85f14 100644 --- a/SushiBar/SushiBarListImplement/Implements/ShopStorage.cs +++ b/SushiBar/SushiBarListImplement/Implements/ShopStorage.cs @@ -100,11 +100,6 @@ namespace SushiBarListImplement.Implements return null; } - public bool IsEnoughSushi(ISushiModel model, int count) - { - throw new NotImplementedException(); - } - public bool SellSushi(ISushiModel model, int count) { throw new NotImplementedException();