示例#1
0
        private void startProductLine(ProductLine pl)
        {
            pl.IsRunning = true;
            _productLineRepository.Update(pl);

            Thread bgThread = new Thread(delegate()
            {
                doLogic();
            });

            bgThread.Start();

            ThreadList.Add(pl.Id, bgThread);
        }
        public async Task Update(Guid id, ProductLineRequestModel request)
        {
            await _productCategoryService.ValidateEntityExistence(request.ProductCategoryId);

            if (_notificationService.HasNotifications())
            {
                return;
            }
            var productLineToUpdate = await _productLineRepository.GetById(id);

            productLineToUpdate.Update(request.Name, request.ProductCategoryId, request.IsActive);
            if (productLineToUpdate.Valid)
            {
                await _productLineRepository.Update(productLineToUpdate);
            }
            else
            {
                _notificationService.AddEntityNotifications(productLineToUpdate.ValidationResult);
            }
        }