CodeGen Related commands in Orchard

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.