Orchard provides a command line tool, which can be used to create users, create blogs, and generate Code And configure websites and packaging modules. This command line tool can be expanded as long as we create a command class in the self-developed module and inherit from the defaultorchardcommandhandler provided by the orcahrd framework. In this way, we can implement the commands that our module can provide in this class. For more information, see the usercommands. CS file in the orchard. Users module provided by default.
Start this command line tool to execute the orchard.exe file in the bindirectory of the orchardwebsite. It is under the orchard. web \ bin directory in the project file.
After the command line tool is initially successful, a prompt line "orchard>" appears. Here we can enter some corresponding commands. For example, the help commands provided by the orchard framework.
It lists all available commands. Enter help <command> (Help + the corresponding command will display the help information of the corresponding command). For example, enter help user create, which is shown as follows:
It prompts us how to input the corresponding parameters when using the command to create a user.
The commands provided by default are clearly explained, so it is not a waste of time to introduce them here. As long as you use the help commands command to list them clearly. Here we will focus on the command for automatically generating code templates, which will be useful when developing the orchard module.
If you need to use the autogenerate function of javashard code, you need to install a code generation module first. We can find and install it in the module market of the Management backend of the orchard website. After the installation is complete, enable this module in features. Of course, you can also use the command line tool to enable it, such as orchard> feature enable orchard. codegeneration. When orchard. codegeneration is enabled, you can run the corresponding commands in the orchard command line to create a module. Currently, the following commands can be used:
Codegen controller <module-Name> <controller-Name>
CreateControllerClass
Codegen datamigration <feature-Name>
Create a data file list
Codegen module <module-Name> [/includeinsolution: True | false]
Create a module
Codegen theme <theme-Name> [/createproject: True | false] [/includeinsolution: True | false] [/basedon: <theme-Name>]
Create a skin
Reference:
Http://www.orchardproject.net/docs/Using-the-command-line-interface.ashxhttp://www.orchardproject.net/docs/Command-line-scaffolding.ashx