Aggregate() private method

private Aggregate ( ) : IEnumerable
return IEnumerable
        public IMigrationBatch Prepare(long timestamp, MigrationOptions options)
        {
            // import all migrations
            IReadOnlyCollection<ImportedMigration> availableMigrations;
            IReadOnlyCollection<ImportedAggregateMigration> availableAggregateMigrations;
            _importer.ImportAll(out availableMigrations, out availableAggregateMigrations);

            // create migration batch
            var executedMigrations = new List<IMigrationMetadata>(_versioning.ExecutedMigrations);
            var migrationSelector = new MigrationSelector(availableMigrations, executedMigrations);
            IEnumerable<ApplicableMigration> applicableMigrations;
            IEnumerable<IMigrationMetadata> unidentifiedMigrations;
            migrationSelector.GetMigrationsTo(timestamp, options.MigrationSelector, out applicableMigrations, out unidentifiedMigrations);
            var migrationAggregator = new MigrationAggregator(applicableMigrations, availableMigrations, availableAggregateMigrations);
            var migrationSteps = migrationAggregator.Aggregate();
            return new MigrationBatch(
                migrationSteps,
                unidentifiedMigrations,
                _versioning,
                _configuration);
        }
Esempio n. 2
0
        public IMigrationBatch Prepare(long timestamp, MigrationOptions options)
        {
            // import all migrations
            IReadOnlyCollection <ImportedMigration>          availableMigrations;
            IReadOnlyCollection <ImportedAggregateMigration> availableAggregateMigrations;

            _importer.ImportAll(out availableMigrations, out availableAggregateMigrations);

            // create migration batch
            var executedMigrations = new List <IMigrationMetadata>(_versioning.ExecutedMigrations);
            var migrationSelector  = new MigrationSelector(availableMigrations, executedMigrations);
            IEnumerable <ApplicableMigration> applicableMigrations;
            IEnumerable <IMigrationMetadata>  unidentifiedMigrations;

            migrationSelector.GetMigrationsTo(timestamp, options.MigrationSelector, out applicableMigrations, out unidentifiedMigrations);
            var migrationAggregator = new MigrationAggregator(applicableMigrations, availableMigrations, availableAggregateMigrations);
            var migrationSteps      = migrationAggregator.Aggregate();

            return(new MigrationBatch(
                       migrationSteps,
                       unidentifiedMigrations,
                       _versioning,
                       _configuration));
        }