Classes

Classes are the main objects of the model. They are represented as shapes on the diagram that can be moved, resized etc.

 

ExpandedToggleIcon        Creating and Editing Classes

Classes can be added to the model either by dragging existing tables from the Database Explorer, or by creating a new class manually.

To create a new class manually, use one of the following ways:

Click the New Class button Images_addclassbutton on the Model toolbar.
Click the New Class button on the Model Explorer toolbar, this will add a new class to the model only.
Press ALT+C shortcut keys.
Right-click the diagram and select New Class from the Add submenu of the shortcut menu.
Right-click the Classes node in the Model Explorer window and select the New Class menu command, this will add a new class to the model only.
Select New Class from the Model menu (available in the standalone application only).

Any of these actions calls the Class Editor dialog where you can set parameters for the class and create class properties.

To create an empty class with the default name:

Press the INSERT key in the Classes node of the Model Explorer window, in this case the class will not be displayed in the diagram area;
Press the INSERT key in the active digram area, this will add an empty class both in the diagram and in the model.

To add an existing class from the Model Explorer window to the diagram area together with the objects related to it, right-click the required class in the Model Explorer window and then select the Add On Diagram With Related context menu option.

Apart from dragging objects from Database Explorer to the model, the Database Explorer window has a set of means designed for adding new classes to a model. These means are implemented as context menu options of a table in Database Explorer:

Add To Model - this option adds a table selected in the Database Explorer window to the model, in this case the class will not be displayed in the diagram area;
Add To Model With Related - this option adds a table selected in the Database Explorer window to the model together with objects related to it; in this case the class and the related objects will not be displayed in the diagram area.

Double-click the class on the diagram or in Model Explorer to edit it. The Class Editor dialog will be displayed. In the Class Editor, you can set class parameters and edit class properties.

To add a property, use either the shortcut menu of the Class Properties grid or the INSERT key, or select the required class and press ALT+P. The Property Editor dialog will be displayed where you can set the property parameters. For more information on property editing, see the Columns topic. To change the property order, drag the properties to their right places.

 

ExpandedToggleIcon        Deleting a Class

To delete a class use one of the following options:

in case you want to delete the class from the diagram area only, select it in the diagram area and press SHIFT+DELETE;
right-click the required class on the diagram area or in the Model Explorer, and select Delete in the context menu or select the required class and press the DELETE key.

Entity Developer will then ask you whether you want to delete the object from the model too.

 

ExpandedToggleIcon        CRUD Operation Overloading

If you want to overload CRUD operations for your class or define them to the particular class - read more about it in Update Methods article.

 

ExpandedToggleIcon        See Also


Send feedback on this topic

© 2008 - 2024 Devart. All rights reserved.