diff --git a/src/GUI/EFCorePowerTools/EFCorePowerToolsPackage.cs b/src/GUI/EFCorePowerTools/EFCorePowerToolsPackage.cs index f141bf686..45664fcc3 100644 --- a/src/GUI/EFCorePowerTools/EFCorePowerToolsPackage.cs +++ b/src/GUI/EFCorePowerTools/EFCorePowerToolsPackage.cs @@ -360,7 +360,7 @@ private async void OnReverseEngineerConfigFileMenuBeforeQueryStatus(object sende menuCommand.Text = ButtonLocale.cmdidReverseEngineerRefresh; break; case PkgCmdIDList.cmdidDabStart: - menuCommand.Text = "EF Core Power Tools - Start DAB"; + menuCommand.Text = "Start Data API Builder"; break; default: @@ -688,7 +688,7 @@ private async void OnReverseEngineerConfigFileMenuInvokeHandler(object sender, E return; } - await VS.MessageBox.ShowConfirmAsync("Launch DAB"); + dabBuilderHandler.LaunchDab(item.FullPath); } } catch (Exception ex) diff --git a/src/GUI/Shared/Handlers/DabBuilderHandler.cs b/src/GUI/Shared/Handlers/DabBuilderHandler.cs index 039c49993..01a1eec0b 100644 --- a/src/GUI/Shared/Handlers/DabBuilderHandler.cs +++ b/src/GUI/Shared/Handlers/DabBuilderHandler.cs @@ -32,6 +32,16 @@ public DabBuilderHandler(EFCorePowerToolsPackage package) vsDataHelper = new VsDataHelper(); } + public void LaunchDab(string configPath) + { + var path = Path.GetDirectoryName(configPath); + + var proc = new Process(); + proc.StartInfo.FileName = "cmd"; + proc.StartInfo.Arguments = $" /k \"cd /d {path} && dab start\""; + proc.Start(); + } + public async System.Threading.Tasks.Task BuildDabConfigAsync(Project project) { await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();