Orchard opens the command line feature for quick code creation.
Because the feature is not turned on by default. The system provides two modes of opening:
1, enter the management backstage->modules-> Find [Code generation]-> click Enable
2. Using the command line tool: Input feature enable orchard.codegeneration
The location of the command-line tool is: Orchard.exe under the bin directory of the web.
For CodeGen, the current orchard provides the following commands:
1. Create a Data migration class
Command: CodeGen datamigration <feature-name>
Description: The feature-name here is actually the name of modules.
Add: A class named: Migrations is generated under the specified modules. This class inherits from Datamigrationimpl.
By adding UpdateFrom1, UpdateFrom2, UpdateFrom3 ... The Updatefromn method works by manipulating the Schemabuilder object to modify the contents of the corresponding data entity.
2. Create a module
Command: CodeGen module <module-name> [/includeinsolution:true|false]
Description: You can specify whether to include in the solution, which is generally included in this scenario. (default value)
3. Create a test project for module
Command: CodeGen moduletests <module-name> [/includeinsolution:true|false]
Description: The project name is Module-name. Tests
4. Create a Theme
Command: CodeGen theme <theme-name> [/createproject:true|false][/includeinsolution:true|false][/basedon:< Theme-name>]
Description: Specifies the parameters: whether the project is created, whether it is included in the solution, and the inherited theme.
5. Create a controller in the specified module
Command: CodeGen controller <module-name> <controller-name>
Description: You need to specify the module name, controller name
more commands, just need to find the system to use the Commandnameattribute property method can be obtained and extended.
CodeGen Related commands in Orchard