Example #1
0
 public OracleSqlDataConnection(
     ISqlConnectionStringProvider connectionStringProvider,
     IDataConnectionConfigProvider dataConnectionConfigProvider)
 {
     _connectionStringProvider     = connectionStringProvider;
     _dataConnectionConfigProvider = dataConnectionConfigProvider;
 }
Example #2
0
        public ManagedIdentitySqlConnectionFactory(ISqlConnectionStringProvider sqlConnectionStringProvider, IAccessTokenHandler accessTokenHandler)
        {
            EnsureArg.IsNotNull(sqlConnectionStringProvider, nameof(sqlConnectionStringProvider));
            EnsureArg.IsNotNull(accessTokenHandler, nameof(accessTokenHandler));

            _sqlConnectionStringProvider = sqlConnectionStringProvider;
            _accessTokenHandler          = accessTokenHandler;
        }
Example #3
0
 public SchemaInitializer(SqlServerDataStoreConfiguration sqlServerDataStoreConfiguration, SchemaUpgradeRunner schemaUpgradeRunner, SchemaInformation schemaInformation, ISqlConnectionFactory sqlConnectionFactory, ISqlConnectionStringProvider sqlConnectionStringProvider, IMediator mediator, ILogger <SchemaInitializer> logger)
 {
     _sqlServerDataStoreConfiguration = EnsureArg.IsNotNull(sqlServerDataStoreConfiguration, nameof(sqlServerDataStoreConfiguration));
     _schemaUpgradeRunner             = EnsureArg.IsNotNull(schemaUpgradeRunner, nameof(schemaUpgradeRunner));
     _schemaInformation           = EnsureArg.IsNotNull(schemaInformation, nameof(schemaInformation));
     _sqlConnectionFactory        = EnsureArg.IsNotNull(sqlConnectionFactory, nameof(sqlConnectionFactory));
     _sqlConnectionStringProvider = EnsureArg.IsNotNull(sqlConnectionStringProvider, nameof(sqlConnectionStringProvider));
     _mediator = EnsureArg.IsNotNull(mediator, nameof(mediator));
     _logger   = EnsureArg.IsNotNull(logger, nameof(logger));
 }
Example #4
0
        public static void Initialize(ISqlConnectionStringProvider connectionStringProvider)
        {
            s_connectionStringProvider = connectionStringProvider;

            var thr = new Thread(new ThreadStart(WriterBody))
            {
                Name = "AsyncLoggerThread", IsBackground = true
            };

            thr.Start();
        }
Example #5
0
        public BaseSchemaRunner(
            ISqlConnectionFactory sqlConnectionFactory,
            ISchemaManagerDataStore schemaManagerDataStore,
            ISqlConnectionStringProvider sqlConnectionStringProvider,
            ILogger <BaseSchemaRunner> logger)
        {
            EnsureArg.IsNotNull(sqlConnectionFactory);
            EnsureArg.IsNotNull(schemaManagerDataStore);
            EnsureArg.IsNotNull(sqlConnectionStringProvider);
            EnsureArg.IsNotNull(logger, nameof(logger));

            _sqlConnectionFactory        = sqlConnectionFactory;
            _schemaManagerDataStore      = schemaManagerDataStore;
            _sqlConnectionStringProvider = sqlConnectionStringProvider;
            _logger = logger;
        }
        private static string GetTokenOrDefault(ISqlConnectionStringProvider connectionStringProvider, int userId)
        {
            using (var ctx = new SqlStandardCallContext(TestHelper.Monitor))
            {
                return(ctx
                       .GetConnectionController(connectionStringProvider)
                       .QuerySingleOrDefault <string>
                       (
                           @"
select s.Token
from CK.tTokenStore s
inner join CK.tGuestActor u on u.TokenId = s.TokenId
where u.GuestActorId = @UserId 
                    ",
                           new { UserId = userId }
                       ));
            }
        }
Example #7
0
        public SqlServerFhirModel(
            SchemaInformation schemaInformation,
            ISearchParameterDefinitionManager searchParameterDefinitionManager,
            FilebasedSearchParameterStatusDataStore.Resolver filebasedRegistry,
            IOptions <SecurityConfiguration> securityConfiguration,
            ISqlConnectionStringProvider sqlConnectionStringProvider,
            ILogger <SqlServerFhirModel> logger)
        {
            EnsureArg.IsNotNull(schemaInformation, nameof(schemaInformation));
            EnsureArg.IsNotNull(searchParameterDefinitionManager, nameof(searchParameterDefinitionManager));
            EnsureArg.IsNotNull(filebasedRegistry, nameof(filebasedRegistry));
            EnsureArg.IsNotNull(securityConfiguration?.Value, nameof(securityConfiguration));
            EnsureArg.IsNotNull(sqlConnectionStringProvider, nameof(sqlConnectionStringProvider));
            EnsureArg.IsNotNull(logger, nameof(logger));

            _schemaInformation = schemaInformation;
            _searchParameterDefinitionManager        = searchParameterDefinitionManager;
            _filebasedSearchParameterStatusDataStore = filebasedRegistry.Invoke();
            _securityConfiguration       = securityConfiguration.Value;
            _sqlConnectionStringProvider = sqlConnectionStringProvider;
            _logger = logger;
        }
Example #8
0
 public ConnectionCreator(ISqlConnectionStringProvider connectionStringProvider)
 {
     m_connectionStringProvider = connectionStringProvider;
 }
Example #9
0
 /// <summary>
 /// Gets the connection controller to use for a given connection string provider.
 /// This is simply a more explicit call to the actual indexer: <see cref="ISqlCallContext.this[ISqlConnectionStringProvider]"/>.
 /// </summary>
 /// <param name="provider">The connection string provider.</param>
 /// <returns>The connection controller to use.</returns>
 public ISqlConnectionController GetConnectionController(ISqlConnectionStringProvider provider) => GetController(provider.ConnectionString);
Example #10
0
 /// <summary>
 /// Gets the connection controller to use for a given connection string provider.
 /// This controller is cached for any new connection string.
 /// </summary>
 /// <param name="provider">The connection string provider.</param>
 /// <returns>The connection controller to use.</returns>
 public ISqlConnectionController this[ISqlConnectionStringProvider provider] => GetController(provider.ConnectionString);
Example #11
0
 /// <summary>
 /// Gets the connection controller to use for a given connection string provider.
 /// This is simply a more explicit call to the actual indexer: <see cref="ISqlCallContext.this[ISqlConnectionStringProvider]"/>.
 /// </summary>
 /// <param name="provider">The connection string provider.</param>
 /// <returns>The connection controller to use.</returns>
 public new ISqlConnectionTransactionController GetConnectionController(ISqlConnectionStringProvider provider) => (ISqlConnectionTransactionController)GetController(provider.ConnectionString);
Example #12
0
 public UserRepository(ISqlConnectionStringProvider connectionStringProvider)
 {
     Context = new PsymendBaseSqlContext(connectionStringProvider);
 }
Example #13
0
 public DataPumperDbConnection(
     ISqlConnectionStringProvider connectionStringProvider)
 {
     _connectionStringProvider = connectionStringProvider;
 }
Example #14
0
 public SqlUserDatabase(ISqlConnectionStringProvider sqlConnectionStringProvider) =>
 this.sqlConnectionStringProvider = sqlConnectionStringProvider;
Example #15
0
 public PsymendBaseSqlContext(ISqlConnectionStringProvider connectionStringProvider) : base(connectionStringProvider)
 {
 }
        public DefaultSqlConnectionFactory(ISqlConnectionStringProvider sqlConnectionStringProvider)
        {
            EnsureArg.IsNotNull(sqlConnectionStringProvider, nameof(sqlConnectionStringProvider));

            _sqlConnectionStringProvider = sqlConnectionStringProvider;
        }
 public LusherInterpretationRepository(ISqlConnectionStringProvider connectionStringProvider)
 {
     Context = new PsymendBaseSqlContext(connectionStringProvider);
 }
Example #18
0
 public PsychoBioTestRepository(ISqlConnectionStringProvider connectionStringProvider)
 {
     Context = new PsymendBaseSqlContext(connectionStringProvider);
 }
Example #19
0
 protected BaseSqlContext(ISqlConnectionStringProvider connectionStringProvider)
 {
     _connectionStringProvider = connectionStringProvider;
 }