PIbd-23. Dolgova D.N. Lab Work 06 base #6

Closed
darya_dolgova wants to merge 2 commits from LabWork6 into LabWork5
Showing only changes of commit a17f38d3db - Show all commits

View File

@ -12,8 +12,9 @@ namespace FishFactoryBusinessLogic.BusinessLogics
{
private readonly ILogger _logger;
private readonly IOrderStorage _orderStorage;
static readonly object _locker = new object();
public OrderLogic(ILogger<OrderLogic> logger, IOrderStorage orderStorage)
public OrderLogic(ILogger<OrderLogic> 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)