diff --git a/ComputersShop/ComputersShopBusinessLogic/BusinessLogics/ShopLogic.cs b/ComputersShop/ComputersShopBusinessLogic/BusinessLogics/ShopLogic.cs index b33660f..1bd7990 100644 --- a/ComputersShop/ComputersShopBusinessLogic/BusinessLogics/ShopLogic.cs +++ b/ComputersShop/ComputersShopBusinessLogic/BusinessLogics/ShopLogic.cs @@ -32,7 +32,8 @@ namespace ComputersShopBusinessLogic.BusinessLogics if (quantity <= 0) { - throw new ArgumentException("Количество добавляемого изделия должно быть больше 0", nameof(quantity)); + return false; + throw new ArgumentException("Количество добавляемого изделия должно быть больше 0", nameof(quantity)); } _logger.LogInformation("AddComputerInShop. ShopName:{ShopName}.Id:{ Id}", model.ShopName, model.Id); diff --git a/ComputersShop/ComputersShopFileImplement/Models/Shop.cs b/ComputersShop/ComputersShopFileImplement/Models/Shop.cs index 29f7631..e2eb630 100644 --- a/ComputersShop/ComputersShopFileImplement/Models/Shop.cs +++ b/ComputersShop/ComputersShopFileImplement/Models/Shop.cs @@ -99,8 +99,8 @@ namespace ComputersShopFileImplement.Models new XElement("ShopAddress", ShopAddress), new XElement("DateOpening", DateOpening.ToString()), new XElement("Capacity", Capacity.ToString()), - new XElement("Сomputers", ComputersCount.Select(x => - new XElement("Сomputer", + new XElement("Computers", ComputersCount.Select(x => + new XElement("Computer", new XElement("Key", x.Key), new XElement("Value", x.Value))) .ToArray()));