всё работает

This commit is contained in:
maxnes3 2023-04-24 20:40:36 +04:00
parent fe67f3f997
commit b0b92c6be3
2 changed files with 4 additions and 3 deletions

View File

@ -32,7 +32,8 @@ namespace ComputersShopBusinessLogic.BusinessLogics
if (quantity <= 0) 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); _logger.LogInformation("AddComputerInShop. ShopName:{ShopName}.Id:{ Id}", model.ShopName, model.Id);

View File

@ -99,8 +99,8 @@ namespace ComputersShopFileImplement.Models
new XElement("ShopAddress", ShopAddress), new XElement("ShopAddress", ShopAddress),
new XElement("DateOpening", DateOpening.ToString()), new XElement("DateOpening", DateOpening.ToString()),
new XElement("Capacity", Capacity.ToString()), new XElement("Capacity", Capacity.ToString()),
new XElement("Сomputers", ComputersCount.Select(x => new XElement("Computers", ComputersCount.Select(x =>
new XElement("Сomputer", new XElement("Computer",
new XElement("Key", x.Key), new XElement("Key", x.Key),
new XElement("Value", x.Value))) new XElement("Value", x.Value)))
.ToArray())); .ToArray()));