public Dictionary <string, string> GetTable() { //for demo purposes, I will create a dictionary here. var data = new Dictionary <string, string>(); data.Add(_tenantIdStrategy.CurrentTenant, _connectionStringProvider.ConnectionString()); return(data); }
public IDapperSession GetSession(string connectionStringName) { if (string.IsNullOrWhiteSpace(connectionStringName)) { throw new ArgumentNullException(nameof(connectionStringName)); } var connection = _configuration.Dialect.GetConnection(_connectionStringProvider.ConnectionString(connectionStringName)); _logger.LogDebug($"get session for {connectionStringName}"); return(new DapperSession(connection)); }
public IDictionary <string, IDapperSession> OpenAndBind() { IDictionary <string, IDapperSession> result = new Dictionary <string, IDapperSession>(); var conStrings = GetAllLoadedContexts(); foreach (var conString in conStrings) { IConnectionStringProvider provider = GetCsProvider(conString); var connection = _configuration.Dialect.GetConnection(provider.ConnectionString(conString)); connection.Open(); var session = new DapperSession(connection); result.Add(conString, session); } return(result); }
public IScheduleContext BuildContext() { return(new ScheduleContext(_connectionStringProvider.ConnectionString(_scheduleConnectionKey))); }