From daa5ec4818e661aab0852009e56fa00202e3a664 Mon Sep 17 00:00:00 2001 From: AnnaLioness Date: Mon, 22 Apr 2024 10:22:20 +0400 Subject: [PATCH] =?UTF-8?q?=D0=BC=D0=B5=D0=BB=D0=BA=D0=B0=D1=8F=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B0=D0=B2=D0=BA=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BusinessLogic/OrderLogic.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/LawFirm/AbstractLawFirmBusinessLogic/BusinessLogic/OrderLogic.cs b/LawFirm/AbstractLawFirmBusinessLogic/BusinessLogic/OrderLogic.cs index 8ef6fe3..aca7bdc 100644 --- a/LawFirm/AbstractLawFirmBusinessLogic/BusinessLogic/OrderLogic.cs +++ b/LawFirm/AbstractLawFirmBusinessLogic/BusinessLogic/OrderLogic.cs @@ -17,8 +17,9 @@ namespace AbstractLawFirmBusinessLogic.BusinessLogic { 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; @@ -90,7 +91,10 @@ namespace AbstractLawFirmBusinessLogic.BusinessLogic public bool TakeOrderInWork(OrderBindingModel model) { - return ChangeStatus(model, OrderStatus.Выполняется); + lock (locker) + { + return ChangeStatus(model, OrderStatus.Выполняется); + } } public bool FinishOrder(OrderBindingModel model)