This topic demonstrates how to execute automated operations using the Model Operation Dialog.
Suppose, you have a domain model based on the SofiaCarRental database.
The first step is to start the Model Operations Dialog:
- Open your domain model in the Visual Designer.
Right-click on an empty area and select Model Operations.... This will start the Model Operations Dialog.
The first important thing to note is the different Display Modes. There are two Display Modes - Entities and Members. The Entities view shows class-table information in the GridView. Unmapped classes and tables are also displayed in the GridView. However, their Class/Table Name are empty, depending on what is missing in the mapping. Respectively, the Members view shows property-column information in the GridView. Navigational properties are displayed as well. The operations that can be executed on navigational properties are limited. Unmapped properties and columns are also displayed in the GridView. However, their Property/Column Name are empty, depending on what is missing in the mapping.
Select the Members mode. This will show property-column information in the GridView.
Next, you will see how to perform model operations on one or more items.
Let's filter the information in the GridView and show only the Car properties:
- In the Search View, expand Class option.
Enter Car in the Name text field. This will filter the items in the GridView and will display only the Car properties.
You are going to rename several Car properties at once.
- Select several Car properties in the GridView by using the Ctrl key.
- In the Model Operations View, select Rename Properties from the Operation drop-down.
Enter some prefix (e.g. "New_").
Press the Execute button.
When you click the Execute button all changes are applied automatically. There is neither Undo functionality nor "Apply Button". Use the model operations carefully.
After model operations are executed, you will be presented with a short report for the changed objects count. For example:
Sometimes the model operations cannot be executed successfully. If there are any errors, the Validation Dialog will appear. For example:
- Select any Boolean property of the Car entity (e.g. DvdPlayer).
- From the Operation drop-down, select Change SQL Type.
- Change the SQL Type to datetime and click Execute.
The Validation Dialog will appear showing the error.
For a complete UI reference, check out the Model Operations Dialog section in Feature Reference.