public async Task ExecuteAsync(UpdateSeoSettingsCommand command, IExecutionContext executionContext)
        {
            var allSettings = await _dbContext
                              .Settings
                              .ToListAsync();

            _settingCommandHelper.SetSettingProperty(command, c => c.HumansTxt, allSettings, executionContext);
            _settingCommandHelper.SetSettingProperty(command, c => c.RobotsTxt, allSettings, executionContext);

            await _dbContext.SaveChangesAsync();

            _transactionScopeFactory.QueueCompletionTask(_dbContext, _settingCache.Clear);
        }
Esempio n. 2
0
        public async Task ExecuteAsync(UpdateSeoSettingsCommand command, IExecutionContext executionContext)
        {
            var allSettings = await _dbContext
                              .Settings
                              .ToListAsync();

            _settingCommandHelper.SetSettingProperty(command, c => c.GoogleAnalyticsUAId, allSettings, executionContext);
            _settingCommandHelper.SetSettingProperty(command, c => c.HumansTxt, allSettings, executionContext);
            _settingCommandHelper.SetSettingProperty(command, c => c.RobotsTxt, allSettings, executionContext);
            _settingCommandHelper.SetSettingProperty(command, c => c.BingWebmasterToolsApiKey, allSettings, executionContext);

            await _dbContext.SaveChangesAsync();

            _settingCache.Clear();
        }
Esempio n. 3
0
        public async Task ExecuteAsync(UpdateVisualEditorSettingsCommand command, IExecutionContext executionContext)
        {
            _permissionValidationService.EnforceIsLoggedIn(executionContext.UserContext);

            var allSettings = await _dbContext
                              .Settings
                              .ToListAsync();

            _settingCommandHelper.SetSettingProperty(command, c => c.VisualEditorDeviceView, allSettings, executionContext);

            await _dbContext.SaveChangesAsync();

            _settingCache.Clear();
        }
Esempio n. 4
0
        public async Task ExecuteAsync(UpdateGeneralSiteSettingsCommand command, IExecutionContext executionContext)
        {
            var allSettings = await _dbContext
                              .Settings
                              .ToListAsync();

            _settingCommandHelper.SetSettingProperty(command, c => c.ApplicationName, allSettings, executionContext);

            await _dbContext.SaveChangesAsync();

            _autoUpdateService.SetLocked(!command.AllowAutomaticUpdates);

            _settingCache.Clear();
        }
        public async Task ExecuteAsync(UpdateGeneralSiteSettingsCommand command, IExecutionContext executionContext)
        {
            var allSettings = await _dbContext
                              .Settings
                              .ToListAsync();

            _settingCommandHelper.SetSettingProperty(command, c => c.ApplicationName, allSettings, executionContext);

            using (var scope = _transactionScopeFactory.Create(_dbContext))
            {
                await _dbContext.SaveChangesAsync();

                await _autoUpdateService.SetLockedAsync(!command.AllowAutomaticUpdates);

                await scope.CompleteAsync();
            }

            _transactionScopeFactory.QueueCompletionTask(_dbContext, _settingCache.Clear);
        }