Complex types and struct objects are data types with internal structure but no key properties. They are represented as light-green shapes on the diagram. They define a data structure composed of scalar or enum properties or other struct objects.
While Entity Developer works with complex types and struct objects in a similar way, there are differences in code generation and how Telerik Data Access allows using them.
Code Generation:
struct keyword) in code.Usage:
In Entity Developer: Both are found in the Complex Types node in the Model Explorer and have no visual differences on the diagram. Both have an Is Struct property that determines whether the type is generated as a struct and how it can be used in the model.
The main properties of complex types are:
Struct objects enable scalar properties to be organized within entities. The fields of these objects are mapped to the same record in the database table as the fields of the parent entity.
You can use complex types for:
To create a struct object from an existing entity:
1. Click the first property in the entity class (for example, the Address property in the Company class).
2. Hold down SHIFT and click the last property you want to include (for example, the Country property).

3. Drag the selected properties out of the entity class and place them onto the empty diagram space.
4. In the displayed Model Refactoring dialog, select the New complex type radio button and click OK.
5. The new complex type is created. Double-click it to edit properties in the Type Editor dialog.

1. Select the classes with a set of common properties.
2. Right-click the selected properties and in the context menu, click Model Refactoring.
3. In the Model Refactoring dialog, click New complex type and then click OK.
4. The new complex type is created with the common set of properties. Double-click it to edit properties in the Type Editor dialog.
Note
If you create a complex type for several classes with a similar subset of properties, and these properties have different facets in different classes, facets from the class that was selected first are taken for the new complex type.
To create a new complex type:
1. Right-click the Complex Types node in the Model Explorer and select New Complex Type from the shortcut menu.
2. The new complex type is added to the model. Double-click it to edit the set of properties.
3. Select the Is Struct checkbox if this complex type should be used as a type of entity property.
To add a property to the newly-added complex type, use one of these options:
To edit a property, right-click it and select Edit Property or press ENTER to display the Property Editor dialog.
To remove a property, right-click it and select Delete Property or press DELETE.
Note
A complex type created in this way is not mapped initially. The Error List window displays a warning: “The complex type
<type name>is not used by any object within the model.”
For detailed information, see Complex type mapping.
Besides the described method, you can create a new complex type by:
To delete a complex type, use one of the following options:
Entity Developer asks whether you also want to delete the object from the model.