public void SetCurrentConnection(IConnectionStringHelper connectionStringHelper) { ConnectionCache connectionCache = GetConnectionCache(connectionStringHelper, "current"); CurrentConnection = connectionCache.Service; CurrentUserDetails = connectionCache.UserDetails; }
public DbConnectionManager(IConfigurationService configurationService, ApplicationNameAndVersion appVersion, IConnectionStringHelper connectionStringHelper, ILoggingService <DbConnectionManager> loggingService, bool storeConnections = true) { _configurationService = configurationService; _appVersion = appVersion; _connectionStringHelper = connectionStringHelper; _loggingService = loggingService; _storeConnections = storeConnections; _dbConnections = new ConcurrentStack <DbConnection>(); }
/// <summary> /// Initializes a new instance of the <see cref="MsSql2014SnapshotServices"/> class. /// </summary> public MsSql2014SnapshotServices( IConnectionStringHelper connectionStringHelper, ISqlHelper sqlHelper) { ArgumentChecks.AssertNotNull(connectionStringHelper, nameof(connectionStringHelper)); ArgumentChecks.AssertNotNull(sqlHelper, nameof(sqlHelper)); this._connectionStringHelper = connectionStringHelper; this._sqlHelper = sqlHelper; }
public QueryConnectHelper( IArchitectureDetector architectureDetector, IConnectionStringHelper connectionStringHelper, IDataChecker dataChecker, IDbConnectionFactory dbConnectionFactory, IExcelWriter excelWriter, ILog log, IRelationshipsDataChecker relationshipsDataChecker, ISharpCloudApiFactory sharpCloudApiFactory) { _architectureDetector = architectureDetector; _connectionStringHelper = connectionStringHelper; _dataChecker = dataChecker; _dbConnectionFactory = dbConnectionFactory; _excelWriter = excelWriter; _logger = log; _relationshipsDataChecker = relationshipsDataChecker; _sharpCloudApiFactory = sharpCloudApiFactory; }
private ConnectionCache GetConnectionCache(IConnectionStringHelper connectionStringHelper, string connectionType) { Logger.WriteLine($"Changing {connectionType} connection to {GetDetails().Username}"); if (!_connectionCache.TryGetValue(GetDetails().Username, out ConnectionCache connectionCache)) { Logger.WriteLine("Connection doesn't exist. Creating new API connection"); connectionCache = new ConnectionCache { Service = new CrmService(connectionStringHelper.GetConnectionString()), UserDetails = new UserDetails { Username = GetDetails().Username, Password = GetDetails().Password } }; connectionCache.UserDetails.UserSettings = UserSettings.GetUserSettings(connectionCache.Service, GetDetails().Username); _connectionCache.Add(GetDetails().Username, connectionCache); } return(connectionCache); }
private QueryConnectHelper CreateQueryConnectHelper( IArchitectureDetector architectureDetector = null, IConnectionStringHelper connectionStringHelper = null, IDataChecker dataChecker = null, IDbConnectionFactory dbConnectionFactory = null, IExcelWriter excelWriter = null, ILog log = null, IRelationshipsDataChecker relationshipsDataChecker = null, ISharpCloudApiFactory sharpCloudApiFactory = null) { return(new QueryConnectHelper( architectureDetector ?? Mock.Of <IArchitectureDetector>(), connectionStringHelper ?? Mock.Of <IConnectionStringHelper>(), dataChecker ?? Mock.Of <IDataChecker>(), dbConnectionFactory ?? Mock.Of <IDbConnectionFactory>(), excelWriter ?? Mock.Of <IExcelWriter>(), log ?? Mock.Of <ILog>(), relationshipsDataChecker ?? Mock.Of <IRelationshipsDataChecker>(), sharpCloudApiFactory ?? Mock.Of <ISharpCloudApiFactory>())); }
public ConnectionHelper(IConnectionStringHelper connectionStringHelper) { this._connectionStringHelper = connectionStringHelper; }
public GameControllerReadQueries(IConnectionStringHelper helper) { _connectionString = helper.ConnectionString; }
public PDFRepository(IConnectionStringHelper connectionString) { _connectionString = connectionString; }
public AreaQueries(IConnectionStringHelper helper) { _connectionString = helper.ConnectionString; }
public SessionQueries(IConnectionStringHelper helper) { _connectionString = helper.ConnectionString; }
public void SetAdminConnection(IConnectionStringHelper connectionStringHelper) { ConnectionCache connectionCache = GetConnectionCache(connectionStringHelper, "admin"); AdminConnection = connectionCache.Service; }