public void Save()
        {
            _productionAreaChangedService
            .AddToMessageList(_context.ChangeTracker.Entries <ProductionArea>());

            _context.SaveChanges();

            _productionAreaChangedService.SendMessagesAsync();
        }
Esempio n. 2
0
        public async Task <Contract.Production> ChangeProductionAreaStatus(int productionId, bool status)
        {
            var production = await GetById(productionId);

            if (production?.On == status)
            {
                return(production);
            }

            await _productionRepository.ChangeProductionAreaStatus(productionId, status);

            var productionModel = new ProductionModel
            {
                ProductionId = production.ProductionId,
                Restrictions = production.Restrictions,
                On           = status
            };

            await _productionAreaChangedService.SendMessagesAsync(productionModel);

            production.On = status;
            return(production);
        }