added logging in ShopLogic.ReplenishManufactures
This commit is contained in:
parent
e80baaa4fe
commit
dd0195a593
@ -88,17 +88,26 @@ namespace BlacksmithWorkshopBusinessLogic.BusinessLogics
|
||||
{
|
||||
_logger.LogInformation("Try to replenish manufactures. ShopName:{ShopName}. Id:{Id}", model.ShopName, model.Id);
|
||||
if (model == null)
|
||||
throw new ArgumentNullException(nameof(model));
|
||||
{
|
||||
_logger.LogWarning("Read operation failed");
|
||||
throw new ArgumentNullException(nameof(model));
|
||||
}
|
||||
ShopViewModel? curModel = ReadElement(model);
|
||||
if (curModel == null)
|
||||
{
|
||||
_logger.LogWarning("Read operation failed");
|
||||
return false;
|
||||
throw new ArgumentNullException(nameof(curModel));
|
||||
}
|
||||
if (manufacture == null)
|
||||
throw new ArgumentNullException(nameof(manufacture));
|
||||
{
|
||||
_logger.LogWarning("Read operation failed");
|
||||
throw new ArgumentNullException(nameof(manufacture));
|
||||
}
|
||||
if (count <= 0)
|
||||
throw new ArgumentException("Количество должно быть положительным числом");
|
||||
{
|
||||
_logger.LogWarning("Read operation failed");
|
||||
throw new ArgumentException("Количество должно быть положительным числом");
|
||||
}
|
||||
if (curModel.ShopManufactures.TryGetValue(manufacture.Id, out var pair))
|
||||
{
|
||||
curModel.ShopManufactures[manufacture.Id] = (pair.Item1, pair.Item2 + count);
|
||||
|
Loading…
Reference in New Issue
Block a user