ASP.NET ZERO Power Tools Using Visual Studio Extension
In this document, we will see how to use the ASP.NET Zero Power Tools Visual Studio Extension to create crud pages.
Entity Information Tab
The Entity Information tab provides a platform to specify entity-specific details. These encompass the entity's name, namespace, database table name, base class, primary key type, and other relevant attributes.
Create User Interface: If you do not select this option, the Power Tools will only create the entity and its related files.
Create View Only: If you select this option, the Power Tools will create only the view pages for the entity.
Create Excel Export Button: If you select this option, the Power Tools will create an Excel export button for the entity and you will be able to export the entity's data to an Excel file.
Create Non-modal CRUD Page: If you want to create CRUD pages without using modals, power tools will create new pages and routes for create and edit operations.
Create Master Detail Page: This option enables you to create a master detail page for the entity. Please refer to the Master Detail Tables document for more information.
Generate Overridable Entity: This option enables you to override created entity classes with creating partial classes.
Track Entity History: This option enables you to track the entity's history. Please refer to the Entity History document for more information.
Add Migration: This option adds a migration for the entity to the database. If you want to add migrations manually, you can just disable this option.
Update Database: This option updates the database after adding the migration. If you want to update the database manually, you can just disable this option.
Host: If you select this option, your entity will be available in the host side.
Tenant: If you select this option, your entity will be available in the tenant side.
Unit Test: If you select this option, the Power Tools will create unit tests based on XUnit & NSubtitute for the entity.
UI Test: If you select this option, the Power Tools will create Playwright UI tests for the entity. (Min ANZ version 12.2.0)
Note: If you select both host and tenant options, your entity will be available in both host and tenant sides.
The Properties tab enables you to configure various settings for the selected entity. This includes defining properties such as strings, integers, booleans, enums, and more. Additionally, you have the option to add validation rules for these properties, such as setting minimum and maximum lengths, specifying whether they are required fields, or utilizing regular expressions.
Furthermore, the tab allows you to enable or disable advanced filtering, create and update options, and listing on the user interface for each of the properties.
Navigation Properties Tab
The Navigation Properties tab enables you to define relationships between entities. This includes one-to-one, one-to-many, and many-to-many relationships. You can also specify the type of relationship, such as whether it is a required field or not. For more information on navigation properties, please refer to the Master Detail Tables document.
Generating CRUD Pages
After configuring the entity, you can create CRUD pages and application services by clicking the Generate button. The Power Tools will create the entity and its related files.
That's it! You can now run the application and see the created pages.