static async Task Main(string[] args) { var db = args.GetValue(0, ""); CodeGeneratorCode.Init(); DB.Init(db); var freeSql = DB.MySql; var data = new Dto.CodegeneratorInputDto() { ControllerNamespace = args.GetValue(1, ""), DtoNamespace = args.GetValue(2, ""), ServiceNamespace = args.GetValue(3, ""), IContractNamespace = args.GetValue(4, ""), EntityNamespace = args.GetValue(5, ""), Output = args.GetValue(6, ""), DataBase = args.GetValue(7, "") }; var result = await CodeGenService.Generator(data); Console.WriteLine($"操作成功!输出目录【{result}】"); Console.ReadKey(); }
/// <summary> /// 添加代码生成 /// </summary> /// <param name="app"></param> /// <returns></returns> public static IApplicationBuilder UseCodeGenerator(this IApplicationBuilder app) { CodeGeneratorCode.Init(); return(app); }