public ISagaSnapshotStorage Create()
        {
            var snapshotStorage = new PostgreSqlSagaSnapshotStorage(PostgreSqlTestHelper.ConnectionHelper, TableName);

            snapshotStorage.EnsureTableIsCreated();

            return(snapshotStorage);
        }
        /// <summary>
        /// Configures Rebus to use PostgreSQL to store saga data snapshots, using the specified table to store the data
        /// </summary>
        public static void StoreInPostgres(this StandardConfigurer <ISagaSnapshotStorage> configurer, IPostgresConnectionProvider connectionProvider, string tableName, bool automaticallyCreateTables = true)
        {
            configurer.Register(c =>
            {
                var sagaStorage = new PostgreSqlSagaSnapshotStorage(connectionProvider, tableName);

                if (automaticallyCreateTables)
                {
                    sagaStorage.EnsureTableIsCreated();
                }

                return(sagaStorage);
            });
        }
Example #3
0
        /// <summary>
        /// Configures Rebus to use PostgreSQL to store saga data snapshots, using the specified table to store the data
        /// </summary>
        public static void StoreInPostgres(this StandardConfigurer <ISagaSnapshotStorage> configurer,
                                           string connectionString, string tableName, bool automaticallyCreateTables = true,
                                           Action <NpgsqlConnection> additionalConnectionSetup = null)
        {
            configurer.Register(c =>
            {
                var sagaStorage = new PostgreSqlSagaSnapshotStorage(new PostgresConnectionHelper(connectionString, additionalConnectionSetup), tableName);

                if (automaticallyCreateTables)
                {
                    sagaStorage.EnsureTableIsCreated();
                }

                return(sagaStorage);
            });
        }