diff --git a/src/GUI/EFCorePowerTools/Contracts/ViewModels/IPickServerDatabaseViewModel.cs b/src/GUI/EFCorePowerTools/Contracts/ViewModels/IPickServerDatabaseViewModel.cs index 180472832..3ba1188ed 100644 --- a/src/GUI/EFCorePowerTools/Contracts/ViewModels/IPickServerDatabaseViewModel.cs +++ b/src/GUI/EFCorePowerTools/Contracts/ViewModels/IPickServerDatabaseViewModel.cs @@ -20,5 +20,7 @@ public interface IPickServerDatabaseViewModel : IViewModel DatabaseConnectionModel SelectedDatabaseConnection { get; set; } DatabaseDefinitionModel SelectedDatabaseDefinition { get; set; } + + bool IncludeViews { get; set; } } } \ No newline at end of file diff --git a/src/GUI/EFCorePowerTools/Contracts/Views/IPickServerDatabaseDialog.cs b/src/GUI/EFCorePowerTools/Contracts/Views/IPickServerDatabaseDialog.cs index a67a66d06..80dd7b4d5 100644 --- a/src/GUI/EFCorePowerTools/Contracts/Views/IPickServerDatabaseDialog.cs +++ b/src/GUI/EFCorePowerTools/Contracts/Views/IPickServerDatabaseDialog.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using Shared.Models; - public interface IPickServerDatabaseDialog : IDialog<(DatabaseConnectionModel Connection, DatabaseDefinitionModel Definition)> + public interface IPickServerDatabaseDialog : IDialog<(DatabaseConnectionModel Connection, DatabaseDefinitionModel Definition, bool IncludeViews)> { void PublishConnections(IEnumerable connections); void PublishDefinitions(IEnumerable definitions); diff --git a/src/GUI/EFCorePowerTools/Dialogs/PickServerDatabaseDialog.xaml b/src/GUI/EFCorePowerTools/Dialogs/PickServerDatabaseDialog.xaml index 26639a5c1..4f6b969c3 100644 --- a/src/GUI/EFCorePowerTools/Dialogs/PickServerDatabaseDialog.xaml +++ b/src/GUI/EFCorePowerTools/Dialogs/PickServerDatabaseDialog.xaml @@ -90,6 +90,14 @@ + + Include views (requires EF Core 3.0) + + _getDialogResult; + private readonly Func<(DatabaseConnectionModel Connection, DatabaseDefinitionModel Definition, bool IncludeViews)> _getDialogResult; private readonly Action> _addConnections; private readonly Action> _addDefinitions; @@ -25,7 +25,7 @@ public PickServerDatabaseDialog(ITelemetryAccess telemetryAccess, DialogResult = args.DialogResult; Close(); }; - _getDialogResult = () => (viewModel.SelectedDatabaseConnection, viewModel.SelectedDatabaseDefinition); + _getDialogResult = () => (viewModel.SelectedDatabaseConnection, viewModel.SelectedDatabaseDefinition, viewModel.IncludeViews); _addConnections = models => { foreach (var model in models) @@ -45,7 +45,7 @@ private void Window_Loaded(object sender, RoutedEventArgs e) DatabaseConnectionCombobox.Focus(); } - public (bool ClosedByOK, (DatabaseConnectionModel Connection, DatabaseDefinitionModel Definition) Payload) ShowAndAwaitUserResponse(bool modal) + public (bool ClosedByOK, (DatabaseConnectionModel Connection, DatabaseDefinitionModel Definition, bool IncludeViews) Payload) ShowAndAwaitUserResponse(bool modal) { bool closedByOkay; diff --git a/src/GUI/EFCorePowerTools/Dialogs/PickTablesDialog.xaml b/src/GUI/EFCorePowerTools/Dialogs/PickTablesDialog.xaml index 1f71313b2..bff82cb25 100644 --- a/src/GUI/EFCorePowerTools/Dialogs/PickTablesDialog.xaml +++ b/src/GUI/EFCorePowerTools/Dialogs/PickTablesDialog.xaml @@ -32,15 +32,15 @@