PIbd-23. Leonteva V.A. Lab work 06 #7

Closed
leonteva.v wants to merge 3 commits from Lab_6 into Lab_5
Showing only changes of commit b89f9d25fd - Show all commits

View File

@ -14,6 +14,7 @@ namespace LawFirmBusinessLogic.BusinessLogics
{
private readonly ILogger _logger;
private readonly IOrderStorage _orderStorage;
static readonly object _locker = new object();
public OrderLogic(ILogger<OrderLogic> logger, IOrderStorage orderStorage)
{
_logger = logger;
@ -79,7 +80,10 @@ namespace LawFirmBusinessLogic.BusinessLogics
}
public bool TakeOrderInWork(OrderBindingModel model)
{
return StatusUpdate(model, OrderStatus.Выполняется);
lock (_locker)
{
return StatusUpdate(model, OrderStatus.Выполняется);
}
}
public List<OrderViewModel>? ReadList(OrderSearchModel? model)
{