Project Generator
To generate projects from the designer project, click the Generate Projects: Profile button in the toolbar or right click on the project node and then select Generate Projects > Profile.
You can use the default profile (by selecting Profile), or create a new generation profile (by selecting New profile). A designer project can create multiple profiles, each containing different configurations for generating different code.
Profiles are stored in the GenerationProfiles folder in the designer project, and you can double click a profile to view or modify the profile settings.
In the Profile wizard, after you finish the configuration, you can click the Code Preview button to preview the code generated or click the Generate Projects button to generate the projects.
Configuring the profile
General configuration
Overwrite: Overwrites the file if a code file with the same name exists.
Entity configuration
Add the schema name as a prefix to the entity name: The name of the schema will be added as the prefix of the entity file name. For example, dbo_cur_emp.dmedm contains a schema prefix "dbo_" and cur_emp.dmedm contains no schema prefix.
Create a schema sub-folder for storing the entity file(s): Creates a folder using the name of the schema and store the entity files in this folder.
Target configuration
You can specify where the projects (and items in each project) will be generated, and which namespace will be used for the projects (you can set it to keep the namespace in sync with the directory structure).
You can modify the relative output path where the projects and items will be generated.
For the [project].Dal project (data access layer), you can also specify the ORM (only EFCore is supported currently).
If there are projects referenced by the current project, you can also select whether to configure the referenced projects separately.
Connection configuration
For each application database, you must configure the database connection here.
By default, a SQLite database (data.db) will be created under the root folder of the [project].WebApi project. You can select other existing database connections or select Add a connection... to create a new database connection. For more information, refer to Selecting a database connection.
Identity database configuration
This setting will be available after you enable authorization and authentication in the Security tab of the project properties page.
You must configure the database connection for storing the credential data.
By default, a SQLite database (identity.db) will be created under the root folder of the [project].WebApi project. You can select other existing database connections or select Add a connection... to create a new database connection.
Generating projects
After you configure the generation profile, you can click Code Preview in the upper right corner of the configuration window to have a preview of the code that will be generated; and then click Generate Projects next to it to generate the C# projects.
When the project generation is successful, the following projects are automatically added to the current solution.
- [project].Common: the development toolkits and extension functions that are referenced or dependent by the Contracts or Identity projects.
- [project].Contracts: the contract layer which defines the contract for the service.
- [project].Controllers: the controller layer which defines the controller for the service.
- [project].Dal: the data access layer such as EF Core which contain the database-related configurations (repository, unit of work, DbContext) and data initialization (value comparers, value converters).
- [project].Vue: Implements the front-end display of the application.
- [project].Services: the service layer which implements the contracts.
- [project].WebApi: the representation layer which sends data to users.
- [project].Identity: the authentication service layer which authorizes the user registration and login internally. This project will be generated only when you enable the authorization.