Skip to content

Commit

Permalink
Actually add Handlebars EF Core 8 support
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikEJ committed Nov 24, 2023
1 parent b541fac commit a95f985
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
Binary file added src/GUI/EFCorePowerTools/CodeTemplates800.zip
Binary file not shown.
3 changes: 3 additions & 0 deletions src/GUI/EFCorePowerTools/EFCorePowerTools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@
<Content Include="CodeTemplates700.zip">
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<Content Include="CodeTemplates800.zip">
<IncludeInVSIX>true</IncludeInVSIX>
</Content>
<None Include="Key.snk" />
<Content Include="PowerToolsReadMe.md">
<IncludeInVSIX>true</IncludeInVSIX>
Expand Down
11 changes: 5 additions & 6 deletions src/GUI/Shared/Helpers/ReverseEngineerHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ public string DropTemplates(string optionsPath, string projectPath, CodeGenerati
case CodeGenerationMode.EFCore7:
zipName = "CodeTemplates700.zip";
break;
case CodeGenerationMode.EFCore8:
zipName = "CodeTemplates800.zip";
break;
default:
throw new ArgumentException($"Unsupported code generation mode for templates: {codeGenerationMode}");
}
Expand Down Expand Up @@ -160,7 +163,8 @@ public IList<TemplateTypeItem> CalculateAllowedTemplates(CodeGenerationMode code
{
var list = new List<TemplateTypeItem>();

if (codeGenerationMode == CodeGenerationMode.EFCore7)
if (codeGenerationMode == CodeGenerationMode.EFCore7
|| codeGenerationMode == CodeGenerationMode.EFCore8)
{
list.Add(new TemplateTypeItem { Key = 0, Value = "C# - Handlebars" });
list.Add(new TemplateTypeItem { Key = 1, Value = "TypeScript - Handlebars" });
Expand All @@ -172,11 +176,6 @@ public IList<TemplateTypeItem> CalculateAllowedTemplates(CodeGenerationMode code
list.Add(new TemplateTypeItem { Key = 0, Value = "C# - Handlebars" });
list.Add(new TemplateTypeItem { Key = 1, Value = "TypeScript - Handlebars" });
}
else if (codeGenerationMode == CodeGenerationMode.EFCore8)
{
list.Add(new TemplateTypeItem { Key = 2, Value = "C# - T4" });
list.Add(new TemplateTypeItem { Key = 3, Value = "C# - T4 (POCO)" });
}

return list;
}
Expand Down
Binary file modified src/GUI/lib/efreveng80.exe.zip
Binary file not shown.

0 comments on commit a95f985

Please sign in to comment.