The tool provides custom code generation task functionality, allowing users to generate code according to specific needs. This article introduces how to create and use custom code generation tasks.
Code generation related features are under the navigation Code Generation/Generation Tasks.
Creating a generation task involves two steps:
A task can contain multiple steps, each with corresponding templates and generation paths.
Assuming you already have an example template, refer to Code Templates if needed.
Click the + button next to the steps list to open the create step page:

Click the + button next to the task list to open the create task page:

The context type specifies what data type the generator uses:
OpenApiPaths object to expose API information. Requires familiarity with OpenAPI.NETAfter creation, return to the task list and click the run button. Based on the context type, you'll select an appropriate data source (searchable), such as a specific entity or configured OpenAPI endpoint.
Custom code generation lets you generate needed code from backend entity or DTO model information, reducing repetitive work and human errors.
You need basic knowledge of razor template writing. Use VS Code to edit razor files for syntax highlighting and code completion.
Future versions will leverage AI to help generate code templates.
ĺ 厚大纲