Exemple #1
0
        private static IConfigurationRepository CreateRepository()
        {
            if (NConfigSettings.DetectIsWeb())
            {
                return(new ConfigurationRepositoryWeb());
            }

            return(new ConfigurationRepository());
        }
Exemple #2
0
        private static INSystemConfigurator CreateSystemConfigurator()
        {
            if (NConfigSettings.DetectIsWeb())
            {
                return(new NWebSystemConfigurator());
            }

            return(new NSystemConfigurator());
        }
Exemple #3
0
        public static IConfigurationService With(Action<INConfigSettings> configureAction)
        {
            var settings = new NConfigSettings();

            configureAction(settings);

            IDictionary<string, ISectionProvider> providers = settings.ConfigurationDataProviders.SelectMany(x => x.Get()).ToDictionary(x => x.Key, x => x.Value);

            return new ConfigurationService(settings.RuntimeContext, providers);
        }