public async Task InitializeAndWarmUp()
        {
            var eventStore = new MsSqlStreamStoreV3(new MsSqlStreamStoreV3Settings(ConnectionString));
            await eventStore.CreateSchemaIfNotExists();

            _outbox = new SqlStreamStoreOutbox(eventStore, TimeSpan.Zero);
            var db = new TestDbContextWithOutbox(ConnectionString, _outbox);

            db.Database.CreateIfNotExists();
            await WarmUp();
        }
        public async Task InitializeAndWarmUp()
        {
            _outbox = new NEventStoreOutbox(Wireup.Init()
                                            .UsingSqlPersistence(null, "System.Data.SqlClient", ConnectionString)
                                            .WithDialect(new MsSqlDialect())
                                            .InitializeStorageEngine()
                                            .UsingJsonSerialization()
                                            .Build(), TimeSpan.Zero);
            var db = new TestDbContextWithOutbox(ConnectionString, _outbox);

            db.Database.CreateIfNotExists();
            await WarmUp();
        }
Esempio n. 3
0
        public async Task EnsureSchemaInitialized()
        {
            // `receptionDelay` should include transaction timeout + clock drift. Otherwise, it may skip events during reception.
            var receptionDelay = TimeSpan.FromMilliseconds(3000);
            var eventStore     = new MsSqlStreamStoreV3(new MsSqlStreamStoreV3Settings(ConnectionString));
            await eventStore.DropAll();

            await eventStore.CreateSchemaIfNotExists();

            _eventStore = eventStore;
            Outbox      = new SqlStreamStoreOutbox(eventStore, receptionDelay);
            var db = new TestDbContextWithOutbox(ConnectionString, Outbox);

            db.Database.CreateIfNotExists();
        }
Esempio n. 4
0
        public void EnsureSchemaInitialized()
        {
            // `receptionDelay` should include transaction timeout + clock drift. Otherwise, it may skip events during reception.
            var receptionDelay = TimeSpan.FromMilliseconds(3000);
            var eventStore     = Wireup.Init()
                                 .UsingSqlPersistence(null, "System.Data.SqlClient", ConnectionString)
                                 .WithDialect(new MsSqlDialect())
                                 .InitializeStorageEngine()
                                 .UsingJsonSerialization()
                                 .Build();

            eventStore.Advanced.Purge();
            _eventStore = eventStore;
            Outbox      = new NEventStoreOutbox(eventStore, receptionDelay);
            var db = new TestDbContextWithOutbox(ConnectionString, Outbox);

            db.Database.CreateIfNotExists();
        }
Esempio n. 5
0
        public async Task EnsureSchemaInitialized()
        {
            // `receptionDelay` should include transaction timeout + clock drift. Otherwise, it may skip events during reception.
            var receptionDelay = TimeSpan.FromMilliseconds(3000);
            var eventStore     = Wireup.Init()
                                 .UsingSqlPersistence(SQLiteFactory.Instance, "Data Source=EventSourcingDoorOutbox.db;journal mode=WAL;cache=private;")
                                 .WithDialect(new SqliteDialect())
                                 .UsingJsonSerialization()
                                 .Build();

            _eventStore = eventStore;
            Outbox      = new NEventStoreOutbox(eventStore, receptionDelay);
            using (var db = new TestDbContextWithOutbox(new SQLiteConnection(ConnectionString), Outbox))
            {
                db.Database.CreateIfNotExists();
            }

            eventStore.Advanced.Initialize();
            eventStore.Advanced.Purge();
        }