示例#1
0
        public OracleStorage(Func <IDbConnection> connectionFactory, OracleStorageOptions options)
        {
            _connectionFactory = connectionFactory ?? throw new ArgumentNullException(nameof(connectionFactory));

            _options = options ?? throw new ArgumentNullException(nameof(options));
            PrepareSchemaIfNecessary(options);

            InitializeQueueProviders();
        }
示例#2
0
 private void PrepareSchemaIfNecessary(OracleStorageOptions options)
 {
     if (options.PrepareSchemaIfNecessary)
     {
         using (var connection = CreateAndOpenConnection())
         {
             OracleObjectsInstaller.Install(connection, options.SchemaName);
         }
     }
 }
示例#3
0
        public OracleStorage(string connectionString, OracleStorageOptions options)
        {
            if (connectionString == null)
            {
                throw new ArgumentNullException(nameof(connectionString));
            }

            if (IsConnectionString(connectionString))
            {
                _connectionString = connectionString;
            }
            else
            {
                throw new ArgumentException($"Could not find connection string with name '{connectionString}' in application config file");
            }

            _options = options ?? throw new ArgumentNullException(nameof(options));
            PrepareSchemaIfNecessary(options);

            InitializeQueueProviders();
        }