Exemple #1
0
 public void Set([NotNull] SettingsRoot settings)
 {
     if (settings == null)
     {
         throw new ArgumentNullException(nameof(settings));
     }
     lock (_updateLock)
     {
         _settingsStorageService.Write(settings);
         _cache = settings;
     }
 }
        private void WriteUnsafe(SettingsRoot oldSettings, SettingsRoot settings)
        {
            _settingsValidationService.Validate(settings);
            var audit = _settingsChangesAuditService.GetAudit(oldSettings, settings);

            if (audit == null)
            {
                return;                // nothing changed
            }
            _settingsChangesAuditRepository.Insert(audit);
            _settingsStorageService.Write(settings);
            _cache = settings;
        }