Example #1
0
        public SettingsProvider(SettingsProviderOptions options)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            _options = options;
        }
Example #2
0
        public static SettingsProviderDictionary AddJson <TSettings>(this SettingsProviderDictionary providers, string path, Action <SettingsProviderOptions> configure = null)
            where TSettings : class, new()
        {
            if (providers == null)
            {
                throw new ArgumentNullException(nameof(providers));
            }

            var options = new SettingsProviderOptions();

            configure?.Invoke(options);

            var provider = new JsonSettingsProvider <TSettings>(options, path);

            providers.Add(provider);

            return(providers);
        }