Пример #1
0
 public T Read <T>(SettingInfo keyInfo, T defaultValue)
 {
     return(Read(keyInfo.Name, defaultValue));
 }
        public static void RemoveIfRetired(this KeyValueConfigurationCollection collection, SettingInfo keyInfo, Version currentVersion)
        {
            if (keyInfo.RemovedFrom == null)
            {
                return;
            }

            if (currentVersion == null)
            {
                throw new ArgumentNullException(nameof(currentVersion), $"Version info is required before setting or removing {keyInfo.Name}");
            }

            if (currentVersion >= keyInfo.RemovedFrom)
            {
                collection.Remove(keyInfo.Name);
            }
        }