/// <exception cref = "SqlException" /> /// <exception cref = "OperationCanceledException" /> static async ValueTask <MigrationDescriptor?> MbNextDescriptor (IDbMigrationProvider dbMigrationProvider, IRwSqlTransaction transaction, String migrationSchema, MigrationDescriptorCollection descriptors, CancellationToken cancellationToken) { var mbLastMigration = await dbMigrationProvider.MaybeLastMigrationInfo(transaction, migrationSchema, cancellationToken); if (!(mbLastMigration is {} lastMigration)) { return(descriptors[0]); }
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); }