Beispiel #1
0
        public MongoDBStateStoreMigration(
            IClaptrapIdentity identity,
            IDbFactory dbFactory,
            IStorageMigrationContainer storageMigrationContainer,
            IMongoDBStateStoreLocatorOptions options)
        {
            var locator             = options.MongoDBStateStoreLocator;
            var connectionName      = locator.GetConnectionName(identity);
            var databaseName        = locator.GetDatabaseName(identity);
            var stateCollectionName = locator.GetStateCollectionName(identity);
            var migration           = new InternalMongoDBSharedCollectionEventStoreMigration(
                connectionName,
                databaseName,
                stateCollectionName,
                dbFactory);
            var migrationKey =
                $"{nameof(MongoDBEventStoreMigration)}_{stateCollectionName}_{databaseName}_{connectionName}";

            _migrationTask = storageMigrationContainer.CreateTask(migrationKey, migration);
        }
        public MongoDBEventStoreMigration(
            ILogger <MongoDBEventStoreMigration> logger,
            IDbFactory dbFactory,
            IMasterOrSelfIdentity masterOrSelfIdentity,
            IStorageMigrationContainer storageMigrationContainer,
            IMongoDBEventStoreOptions options)
        {
            var locator             = options.MongoDBEventStoreLocator;
            var identity            = masterOrSelfIdentity.Identity;
            var connectionName      = locator.GetConnectionName(identity);
            var databaseName        = locator.GetDatabaseName(identity);
            var eventCollectionName = locator.GetEventCollectionName(identity);
            var migration           = new InternalMongoDBSharedCollectionEventStoreMigration(
                connectionName,
                databaseName,
                eventCollectionName,
                dbFactory);
            var migrationKey =
                $"{nameof(MongoDBEventStoreMigration)}_{connectionName}_{databaseName}_{eventCollectionName}";

            _migrationTask = storageMigrationContainer.CreateTask(migrationKey, migration);
        }