Configuring business object types

You can change how a business object behaves by changing its type. In this step, you make the Category business object act as both a parent and a child object, by changing its type from EditableRoot to SwitchableObject.

You configure the business object type of each entity in Manage Outputs:

  1. In Solution Explorer, right-click Entities.csp and select Manage Outputs.

  2. Double-click the Entities.cst output. The Edit Output dialog lets you control exactly what gets generated.

    The Edit Output dialog for Entities.csp, with the 6a. Entities category expanded and dbo.Category among the EditableRoot tables

  3. Click the ... button of the SwitchableObject property. Hold down Ctrl to select more than one item, and select Category.

    The Edit Output dialog with dbo.Category moved from EditableRoot to SwitchableObject

    The Category table moves from EditableRoot to SwitchableObject.

    Note

    The Entities template knows you might want both an editable object and a read-only object for the same table. When you pick a read-only type for a table that already has an editable type (or the other way around), it keeps the previous choice, and you get two business objects.

  4. Click OK to save your settings.

When you regenerate the project, Category is generated as a SwitchableObject.

Tip

To change a setting at any time, go back to the Edit Output dialog. You can change business object types, the data access implementation and much more. See the Entities template properties.

Next, generate business objects from views and stored procedures: Generating from views and stored procedures.