public static void Build(string outputdir, string projName) { if (string.IsNullOrEmpty(outputdir) || string.IsNullOrEmpty(projName)) { throw new ArgumentNullException("outputdir 和 projName", "不能为空"); } outputDir = outputdir; projectName = projName; CreateDir(); CreateCsproj(); EnumsDal.Generate(Path.Combine(outputdir, projName + ".db"), modelPath, GeneralFactory.projectName); List <string> schemaList = SchemaDal.Get_List(); foreach (var schemaName in schemaList) { Console.WriteLine("正在生成模式:{0}", schemaName); List <TableViewModel> tableList = GetTables(schemaName); foreach (var item in tableList) { Console.WriteLine("{0}:{1}", item.type, item.name); TablesDal td = new TablesDal(GeneralFactory.projectName, modelPath, dalPath, schemaName, item); td.Generate(); } } }
public void Build() { var schemas = new SchemaDal().List(); var plugins = FindPlugins(schemas); CreateDir(); CreateCsproj(plugins); CreateEnums(plugins); CreateModels(schemas); }