To generate projects from the designer-developed 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 generation profile).
The profiles will be stored in the GenerationProfiles folder in the designer project, and you can double click the 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
Overwrite: Overwrites all the existing code with the same file names.
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.
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 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.
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 New... to create new database connection. For more information, refer to Selecting a database connection.
Identity database configuration
This setting will be available after you enable the 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 New... to create new database connection.
After you configure the generation profile, you can click Code Preview to have a preview of the code that will be generated; and then click Generate Projects 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].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.