PIbd-21 Potapov N.S. LabWork02 Hard #9

Closed
ns.potapov wants to merge 34 commits from LabWorkHard02 into LabWork02
Showing only changes of commit 19415b5c7b - Show all commits

View File

@ -181,9 +181,7 @@ namespace SecuritySystemBusinessLogic.BusinessLogics
public bool CheckSecuresCount(ISecureModel model, int count)
{
int securesInShops = _shopStorage.GetFullList()
.Select(
x => x.ShopSecures.Select(y => y.Value.Item1.Id == model.Id ? y.Value.Item2 : 0).Sum()
).Sum();
.Select(x => x.ShopSecures.Select(y => y.Value.Item1.Id == model.Id ? y.Value.Item2 : 0).Sum()).Sum();
return securesInShops >= count;
}
public bool CheckSupplySecures(ShopSearchModel shopSearchModel, int count)
@ -191,9 +189,6 @@ namespace SecuritySystemBusinessLogic.BusinessLogics
if (shopSearchModel == null)
throw new ArgumentNullException(nameof(shopSearchModel));
if (secure == null)
throw new ArgumentNullException(nameof(secure));
var shop = _shopStorage.GetElement(shopSearchModel);
if (shop == null)