Пример #1
0
        public static DbConnConfig Create(string connectionName, string dataProvider, string connString)
        {
            var config = new DbConnConfig();

            config.DataProvider     = dataProvider;
            config.ConnectionName   = connectionName;
            config.ConnectionString = connString;
            return(config);
        }
Пример #2
0
        public Task SaveDbConnConfig(DbConnConfig config)
        {
            if (config == null)
            {
                throw new ArgumentNullException(nameof(config));
            }

            ConfigCache.Save(Tenant, config);
            _shellSettings.ShellConfiguration[DbConnConfigConst.DataProvider] = config.DataProvider;
            _shellSettings.ShellConfiguration[config.ConnectionName]          = config.ConnectionString;
            return(_shellSettingsManager.SaveSettingsAsync(_shellSettings));
        }
Пример #3
0
        public void Save(string tenant, DbConnConfig config)
        {
            var key = tenant + ":" + config.DataProvider + ":" + config.ConnectionName;

            Connections[key] = config;
        }