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

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

            return(new NSystemConfigurator());
        }
Esempio n. 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);
        }