Creating and Editing Properties

Properties are basic elements that compose model objects, which describe presentation of high level architecture such as fields and tables of a database. Properties can be divided into scalar, complex type, enum and navigation properties. Scalar properties are properties of a model object that map to a database table column and have one of the predefined Entity Framework types. Complex type properties are mapped to several columns of a database table. Enum properties are mapped to a database table column, that can accept a certain set of values and then these values are defined in the model as an enum object. Scalar and complex type properties, and enum members are listed inside the upper part of an object on the diagram area. Navigation properties are properties of a model object that describe navigation from one end of an association to the other end. They are listed inside the collapsible Navigation Properties node of an object presented on the diagram area.

The following procedure shows how to create, edit and delete scalar and complex type properties.

 

ExpandedToggleIcon        Creating a Property

To create a new property within a class, use one of the following options:

In the Model Explorer window or in the diagram area right-click the required class to call its context menu, and in the Add submenu select New Property, or select the required class and press ALT+P, this will call the Property Editor dialog.
In the Class Editor dialog press INSERT, or right-click the Class Properties grid and select Add Property in the context menu.
Select the required class and press INSERT.

To create a new property within a complex type, use one of the following options:

In the Model Explorer window or in the diagram area right-click the required complex type to call its context menu, and in the Add submenu select New Property, or select the required class and press ALT+P, this will call the Property Editor dialog.
In the Type Editor dialog press INSERT, or right-click the Properties grid and select Add Property in the context menu.
Select the required complex type and press INSERT.

The Property Editor dialog box is displayed:

Images_Property-Editor-EF-2

Specify the required settings and click OK.

note Note

When creating a new property, pay attention to the Storage Column option. It allows you to map the property to the corresponding table column in the Storage part of your model. Behavior of this option is closely connected with the feature of automatic mapping synchronization (Model Settings -> Mapping -> the Enable automatic synchronization of storage part and mapping of the model with its conceptual part check box). If automatic synchronization is on, and you create a new property within a class, Entity Developer automatically creates the corresponding column in the storage part, which can be accessed by clicking the three-dotted button in the Storage Column combo-box and immediately customized. In case automatic synchronization is off, you can only use the drop-down list to set the value of this option to an already existing storage part column.

note Note

Keep in mind, that the Storage Column option is disabled for complex type properties and class properties having type equal to a complex type.

The new property is created.

 

ExpandedToggleIcon        Editing a Property

To edit a property within a class, use one of the following options:

In the Model Explorer window or in the diagram area right-click the required property and in its context menu select Edit.
In the Class Editor dialog right-click the required property in the Class Properties grid and select Edit Property in the context menu.

To edit a property within a complex type, use one of the following options:

In the Model Explorer window or in the diagram area right-click the required property and in its context menu select Edit.
In the Type Editor dialog right-click the required property in the Properties grid and select Edit Property in the context menu.

The Property Editor dialog box is displayed.

Change the required settings and click OK.

note Note

Not all of the properties of a property can be set in the Property Editor dialog box. Additional properties can be set in the Properties docking window.

 

ExpandedToggleIcon        Deleting a Property

To delete a property use one of the following options:

right-click the required property in the diagram area or in the Model Explorer, and select Delete in the context menu;
select the required property and press the DELETE key.

 

ExpandedToggleIcon        Options for Working with the Storage Part

The context menu for a property contains the following options:

Select Storage - looks for a table column in the Storage part, to which the class property in the Conceptual model is mapped.

Create Storage and Mapping - for a class property in the Conceptual model, this option creates the corresponding table column in the Storage part and the corresponding mapping between them. If this option is selected for a column already having a Storage counterpart and mapping, a dialog box will be displayed offering to create the Storage object and mapping anew. In fact this option is a manual call of synchronization for a particular object in the Conceptual model. For more information on how to turn mapping synchronization on and off, refer to Mapping Synchronization topic.

 

ExpandedToggleIcon        See Also


Send feedback on this topic

© 2008 - 2024 Devart. All rights reserved.