模板增加放入的目录
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
bfe5379206
commit
706cb888c8
|
@ -74,6 +74,10 @@
|
||||||
<Folder Include="TT_Template\Models_New\" />
|
<Folder Include="TT_Template\Models_New\" />
|
||||||
<Folder Include="TT_Template\Services_New\" />
|
<Folder Include="TT_Template\Services_New\" />
|
||||||
<Folder Include="TemplateOutPut\" />
|
<Folder Include="TemplateOutPut\" />
|
||||||
|
<Folder Include="TemplateOutPut\Entity\" />
|
||||||
|
<Folder Include="TemplateOutPut\IService\" />
|
||||||
|
<Folder Include="TemplateOutPut\Service\" />
|
||||||
|
<Folder Include="TemplateOutPut\DTO\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -55,6 +55,9 @@ partial class Program
|
||||||
|
|
||||||
var fileName=Path.GetFileNameWithoutExtension(templateFilePath);
|
var fileName=Path.GetFileNameWithoutExtension(templateFilePath);
|
||||||
|
|
||||||
|
//模板放入具体的文件夹
|
||||||
|
var folder = fileName == "Entity" ? "Entity" : fileName.Replace("Entity", "");
|
||||||
|
|
||||||
foreach (var tableName in tableNames)
|
foreach (var tableName in tableNames)
|
||||||
{
|
{
|
||||||
var model = new TemplateModel
|
var model = new TemplateModel
|
||||||
|
@ -75,7 +78,7 @@ partial class Program
|
||||||
|
|
||||||
//Console.WriteLine(template.Render(context));
|
//Console.WriteLine(template.Render(context));
|
||||||
|
|
||||||
string outputFilePath = Path.Combine(outPutTemplateFolderPath, $"{fileName.Replace("Entity", tableName)}.cs");
|
string outputFilePath = Path.Combine(outPutTemplateFolderPath, folder, $"{fileName.Replace("Entity", tableName)}.cs");
|
||||||
|
|
||||||
File.WriteAllText(outputFilePath, template.Render(context));
|
File.WriteAllText(outputFilePath, template.Render(context));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue