コード例 #1
0
ファイル: ProductService.cs プロジェクト: akshatdataman/Test
        private void startProductLine(ProductLine pl)
        {
            pl.IsRunning = true;
            _productLineRepository.Update(pl);

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

            bgThread.Start();

            ThreadList.Add(pl.Id, bgThread);
        }
コード例 #2
0
        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);
            }
        }