Ejemplo n.º 1
0
 private static void InvokeControllerScaffoldGenerator(ModelDefinition model)
 {
     List<Controllers.ActionDefinition> actions=new List<Controllers.ActionDefinition>();
      Controllers.ControllerGenerator generator = new Controllers.ControllerGenerator(currentPath, actions, model.Name);
      VerifyControllersFolder(currentPath);
      VerifyControllerSubFolder(currentPath, model.Name);
      generator.GenerateScaffoldClass(model);
      VerifyViewSubFolder(currentPath, model.Name);
      VerifiViewLayout(currentPath);
      generator.GenerateScaffoldViews(model);
 }
Ejemplo n.º 2
0
 private static ModelDefinition InvokeModelGenerator(string[] args)
 {
     string className;
     ModelDefinition model = new ModelDefinition();
     List<string> fields = new List<string>();
     if (args.Length > 2)
     {
         className = args[2];
         for (var i = 3; i < args.Length; i++)
         {
             if (args[i].Contains(':'))
             {
                 fields.Add(args[i]);
             }
         }
         Models.ModelGenerator generator = new Models.ModelGenerator(fields.ToArray(), className);
         generator.ParseFields();
         VerfifyModelsFolder(currentPath);
         VerfifyMigrationsFolder(currentPath);
         generator.GenerateClass(currentPath);
         model = generator.Definition;
     }
     return model;
 }