2023-01-03 18:05:57 +08:00
|
|
|
|
using Yi.Framework.Template;
|
|
|
|
|
|
using Yi.Framework.Template.Provider;
|
|
|
|
|
|
|
|
|
|
|
|
TemplateFactory templateFactory = new();
|
|
|
|
|
|
|
|
|
|
|
|
//选择需要生成的模板提供者
|
2023-01-03 20:06:16 +08:00
|
|
|
|
|
|
|
|
|
|
string modelName = "ERP";
|
|
|
|
|
|
string entityName = "Test";
|
|
|
|
|
|
|
2023-01-03 18:05:57 +08:00
|
|
|
|
templateFactory.CreateTemplateProviders((option) =>
|
|
|
|
|
|
{
|
2023-01-03 20:06:16 +08:00
|
|
|
|
option.Add(new ServceTemplateProvider(modelName, entityName));
|
2023-01-03 21:03:07 +08:00
|
|
|
|
option.Add(new IServceTemplateProvider(modelName, entityName));
|
2023-01-03 18:05:57 +08:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
//开始构建模板
|
2023-01-03 20:06:16 +08:00
|
|
|
|
templateFactory.BuildTemplate();
|
|
|
|
|
|
Console.WriteLine("Yi.Framework.Template模板生成完成!");
|
|
|
|
|
|
Console.ReadKey();
|