/// <summary>
        /// JSON configuration storage. "config.json"
        /// </summary>
        /// <returns></returns>
        public IConfigurationStorage GetConfigurationStorage(string name, IConfigurationProtectionFactory protection)
        {
            var loader = string.IsNullOrEmpty(name)
                ? new JsonConfigurationFileLoader()
                : new JsonConfigurationFileLoader(name);
            var cache = new JsonConfigurationCache(loader)
            {
                ReadTimeout             = 2000,
                WriteTimeout            = 2000,
                ConfigurationProtection = protection,
            };

            return(new JsonConfigurationStorage(cache));
        }
예제 #2
0
        public IConfigurationStorage GetConfigurationStorage(string configurationName, IConfigurationProtectionFactory protection)
        {
            if (string.IsNullOrEmpty(configurationName))
            {
                configurationName = "default";
            }
            var loader = new SqliteConfigurationLoader(GetConnection, configurationName);
            var cache  = new JsonConfigurationCache(loader)
            {
                WriteTimeout            = 1000,
                ConfigurationProtection = protection
            };

            return(new JsonConfigurationStorage(cache));
        }