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); }
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)); }
public void Save(string tenant, DbConnConfig config) { var key = tenant + ":" + config.DataProvider + ":" + config.ConnectionName; Connections[key] = config; }