private static void CreateCode()
 {
     Def.CodeDefinitionCollection.Where(o => o.Source == "Def").ForEach(codeDefinition =>
     {
         var code = Creators.Create(codeDefinition, new DataContainer("DefinitionFile"));
         if (code != string.Empty)
         {
             Merger.Merge(codeDefinition.OutputPath, code, codeDefinition.MergeToExisting);
         }
     });
 }
示例#2
0
 private static void CreateNotRepeat(string target)
 {
     Def.CodeDefinitionCollection
     .Where(o => target.IsNullOrEmpty() || o.Id == target)
     .Where(o => o.Source == "Mvc")
     .Where(o => o.RepeatType.IsNullOrEmpty())
     .ForEach(codeDefinition =>
              Merger.Merge(
                  Directories.Outputs(codeDefinition.OutputPath),
                  Creators.Create(codeDefinition, new DataContainer("Table")),
                  codeDefinition.MergeToExisting));
 }
示例#3
0
 private static void CreateEachTable(string target)
 {
     Def.TableNameCollection().ForEach(tableName =>
                                       Def.CodeDefinitionCollection
                                       .Where(o => target.IsNullOrEmpty() || o.Id == target)
                                       .Where(o => o.Source == "Mvc")
                                       .Where(o => o.RepeatType == "Table")
                                       .Where(o => !Table.CheckExclude(o, tableName))
                                       .ForEach(codeDefinition =>
     {
         var dataContainer       = new DataContainer("Table");
         var modelName           = Def.ModelNameByTableName(tableName);
         dataContainer.TableName = tableName;
         dataContainer.ModelName = modelName;
         var code = ReplacePlaceholder(
             Creators.Create(codeDefinition, dataContainer), tableName, modelName);
         var fileName = ReplacePlaceholder(
             Directories.Outputs(codeDefinition.OutputPath), tableName, modelName);
         Merger.Merge(fileName, code, codeDefinition.MergeToExisting);
     }));
 }