/// <summary>
        /// Updates the current configuration.
        /// </summary>
        public async Task UpdateAsync(UpdateDynamicConfigVM request)
        {
            var wrapper = await _db.DynamicConfig.FirstAsync();

            var config = _mapper.Map <DynamicConfig>(request);

            wrapper.Value = JsonConvert.SerializeObject(config);
        }
Esempio n. 2
0
        public async Task <ActionResult> Update(UpdateDynamicConfigVM vm)
        {
            var oldValue = await _configMgr.RequestUpdateAsync();

            await _configMgr.UpdateAsync(vm);

            await _db.SaveChangesAsync();

            _config.ResetCache();

            if (oldValue.TreeRenderThoroughness != vm.TreeRenderThoroughness)
            {
                _alarm.FireTreeLayoutRegenerationRequired();
            }

            return(RedirectToSuccess("Настройки сохранены"));
        }