public async Task GenerateAsync(CancellationToken cancellationToken = default) { var tablesTask = Database.GetAllTables(cancellationToken).ToListAsync(cancellationToken).AsTask(); var viewsTask = Database.GetAllViews(cancellationToken).ToListAsync(cancellationToken).AsTask(); var sequencesTask = Database.GetAllSequences(cancellationToken).ToListAsync(cancellationToken).AsTask(); var synonymsTask = Database.GetAllSynonyms(cancellationToken).ToListAsync(cancellationToken).AsTask(); var routinesTask = Database.GetAllRoutines(cancellationToken).ToListAsync(cancellationToken).AsTask(); await Task.WhenAll(tablesTask, viewsTask, sequencesTask, synonymsTask, routinesTask).ConfigureAwait(false); var tables = await tablesTask.ConfigureAwait(false); var views = await viewsTask.ConfigureAwait(false); var sequences = await sequencesTask.ConfigureAwait(false); var synonyms = await synonymsTask.ConfigureAwait(false); var routines = await routinesTask.ConfigureAwait(false); var rowCounts = await GetRowCountsAsync(tables, cancellationToken).ConfigureAwait(false); var dbVersion = await Connection.Dialect.GetDatabaseDisplayVersionAsync(Connection, cancellationToken).ConfigureAwait(false); var renderers = GetRenderers(tables, views, sequences, synonyms, routines, rowCounts, dbVersion); var renderTasks = renderers.Select(r => r.RenderAsync(cancellationToken)).ToArray(); await Task.WhenAll(renderTasks).ConfigureAwait(false); var assetExporter = new AssetExporter(); await assetExporter.SaveAssetsAsync(ExportDirectory).ConfigureAwait(false); }