Skip to content

Commit

Permalink
remove too strict check
Browse files Browse the repository at this point in the history
fixes #1988
  • Loading branch information
ErikEJ committed Oct 29, 2023
1 parent 6f5beec commit 464b055
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -377,13 +377,11 @@ private async Task<bool> 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;
}

Expand Down
6 changes: 3 additions & 3 deletions src/GUI/Shared/Helpers/ReverseEngineerHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public string DropTemplates(string optionsPath, string projectPath, CodeGenerati
return string.Empty;
}

public (CodeGenerationMode UsedMode, IList<CodeGenerationItem> AllowedVersions) CalculateAllowedVersions(CodeGenerationMode codeGenerationMode, Version minimumVersion, Version vsVersion)
public (CodeGenerationMode UsedMode, IList<CodeGenerationItem> AllowedVersions) CalculateAllowedVersions(CodeGenerationMode codeGenerationMode, Version minimumVersion)
{
var list = new List<CodeGenerationItem>();

Expand All @@ -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())
Expand Down

0 comments on commit 464b055

Please sign in to comment.