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)