From 464b055fc2b5aeb0ba96677261e85cb848166fe8 Mon Sep 17 00:00:00 2001 From: Erik Ejlskov Jensen Date: Sun, 29 Oct 2023 15:01:57 +0100 Subject: [PATCH] remove too strict check fixes #1988 --- .../Handlers/ReverseEngineer/ReverseEngineerHandler.cs | 6 ++---- src/GUI/Shared/Helpers/ReverseEngineerHelper.cs | 6 +++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/GUI/Shared/Handlers/ReverseEngineer/ReverseEngineerHandler.cs b/src/GUI/Shared/Handlers/ReverseEngineer/ReverseEngineerHandler.cs index 13555dcb8..f574b298d 100644 --- a/src/GUI/Shared/Handlers/ReverseEngineer/ReverseEngineerHandler.cs +++ b/src/GUI/Shared/Handlers/ReverseEngineer/ReverseEngineerHandler.cs @@ -377,13 +377,11 @@ private async Task ChooseDataBaseConnectionAsync(ReverseEngineerOptions op psd.PublishSchemas(options.Schemas); } - var vsVersion = await package.VisualStudioVersionAsync(); - - var (usedMode, allowedVersions) = reverseEngineerHelper.CalculateAllowedVersions(options.CodeGenerationMode, await project.GetEFCoreVersionHintAsync(), vsVersion); + var (usedMode, allowedVersions) = reverseEngineerHelper.CalculateAllowedVersions(options.CodeGenerationMode, await project.GetEFCoreVersionHintAsync()); if (!allowedVersions.Any()) { - VSHelper.ShowError($".NET 5 and earlier is not supported, and EF Core 8 requires Visual Studio 2022 version 17.8 or later"); + VSHelper.ShowError($".NET 5 and earlier is not supported."); return false; } diff --git a/src/GUI/Shared/Helpers/ReverseEngineerHelper.cs b/src/GUI/Shared/Helpers/ReverseEngineerHelper.cs index adc0d9ef7..74e10b64b 100644 --- a/src/GUI/Shared/Helpers/ReverseEngineerHelper.cs +++ b/src/GUI/Shared/Helpers/ReverseEngineerHelper.cs @@ -126,7 +126,7 @@ public string DropTemplates(string optionsPath, string projectPath, CodeGenerati return string.Empty; } - public (CodeGenerationMode UsedMode, IList AllowedVersions) CalculateAllowedVersions(CodeGenerationMode codeGenerationMode, Version minimumVersion, Version vsVersion) + public (CodeGenerationMode UsedMode, IList AllowedVersions) CalculateAllowedVersions(CodeGenerationMode codeGenerationMode, Version minimumVersion) { var list = new List(); @@ -136,9 +136,9 @@ public string DropTemplates(string optionsPath, string projectPath, CodeGenerati list.Add(new CodeGenerationItem { Key = (int)CodeGenerationMode.EFCore6, Value = "EF Core 6" }); } - if (minimumVersion.Major == 8 && vsVersion >= new Version(17, 8)) + if (minimumVersion.Major == 8) { - list.Add(new CodeGenerationItem { Key = (int)CodeGenerationMode.EFCore8, Value = "EF Core 8 (preview)" }); + list.Add(new CodeGenerationItem { Key = (int)CodeGenerationMode.EFCore8, Value = "EF Core 8 (rc)" }); } if (!list.Any())