public DbMigrationService (DbMigrationState state, IDbProvider dbProvider, IDbMigrationProvider dbMigrationProvider, IDbMigrationPlan migrationPlan, IHostApplicationLifetime appLifetime, IServiceProvider serviceProvider, ILogger <DbMigrationService> logger) { this.state = state; this.dbProvider = dbProvider; this.dbMigrationProvider = dbMigrationProvider; this.migrationPlan = migrationPlan; this.appLifetime = appLifetime; this.serviceProvider = serviceProvider; this.logger = logger; }
static (String schema, MigrationDescriptorCollection descriptors) Descript(IDbMigrationPlan migrationPlan) { var schema = migrationPlan.migrationSchema switch { null => throw new Exception("Migration schema is null."), "" => throw new Exception("Migration schema is empty string."), {} value when IsNullOrWhiteSpace(value) => throw new Exception("Migration schema is white space."), { } value => value }; var migrationDescriptors = new MigrationDescriptorCollection(); migrationPlan.Configure(migrationDescriptors); return(schema, migrationDescriptors); }