From a17f38d3db997ced32355453a8130912d9024204 Mon Sep 17 00:00:00 2001 From: Dasha Date: Wed, 8 May 2024 22:17:21 +0400 Subject: [PATCH] done --- .../BusinessLogics/OrderLogic.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/FishFactory/FishFactoryBusinessLogic/BusinessLogics/OrderLogic.cs b/FishFactory/FishFactoryBusinessLogic/BusinessLogics/OrderLogic.cs index c67efe2..f420a28 100644 --- a/FishFactory/FishFactoryBusinessLogic/BusinessLogics/OrderLogic.cs +++ b/FishFactory/FishFactoryBusinessLogic/BusinessLogics/OrderLogic.cs @@ -12,8 +12,9 @@ namespace FishFactoryBusinessLogic.BusinessLogics { private readonly ILogger _logger; private readonly IOrderStorage _orderStorage; + static readonly object _locker = new object(); - public OrderLogic(ILogger logger, IOrderStorage orderStorage) + public OrderLogic(ILogger logger, IOrderStorage orderStorage) { _logger = logger; _orderStorage = orderStorage; @@ -67,7 +68,11 @@ namespace FishFactoryBusinessLogic.BusinessLogics public bool TakeOrderInWork(OrderBindingModel model) { - return StatusUpdate(model, OrderStatus.Выполняется); + lock (_locker) + { + return StatusUpdate(model, OrderStatus.Выполняется); + } + } public bool DeliveryOrder(OrderBindingModel model)