Skip to content

Latest commit

 

History

History
54 lines (42 loc) · 2.73 KB

how-to-add-an-entity-to-a-model.md

File metadata and controls

54 lines (42 loc) · 2.73 KB
title description ms.date ms.topic f1_keywords dev_langs helpviewer_keywords author ms.author manager ms.subservice
Add an Entity to a Model
Add an entity to a model by adding an entity control from the Visual Studio Toolbox onto the Business Data Connectivity (BDC) designer.
02/02/2017
how-to
EntityTool
VB
CSharp
BDC [SharePoint development in Visual Studio], entity
Business Data Connectivity service [SharePoint development in Visual Studio], adding an entity
Business Data Connectivity service [SharePoint development in Visual Studio], entity
BDC [SharePoint development in Visual Studio], adding an entity
John-Hart
johnhart
mijacobs
sharepoint-development

Add an entity to a model

To create an entity, add an entity control from the Visual Studio Toolbox onto the Business Data Connectivity (BDC) designer.

To add an entity to the model

  1. Create a BDC project, or open an existing BDC project. For more information, see Create a business data connectivity model.

  2. In the Toolbox, from the BusinessDataCatalog group, add an Entity control onto the designer.

    The new entity appears on the designer. Visual Studio adds an <Entity> element to the XML of the BDC model file in your project. For more information about the attributes of an Entity element, see Entity.

  3. On the designer, open the shortcut menu for the entity, choose Add, and then choose Identifier.

    A new identifier appears on the entity.

    [!NOTE] You can change the name of the entity and the identifier in the Properties window.

  4. Define the fields of the entity in a class. You can either add a new class to the project or use an existing class created by using other tools such as the Object Relational Designer (O/R Designer). The following example shows an entity class named Contact.

    :::code language="csharp" source="../sharepoint/codesnippet/CSharp/sp_bdc_entity_data_class/bdcmodel1/contact.cs" id="Snippet1":::

    :::code language="vb" source="../sharepoint/codesnippet/VisualBasic/sp_bdc_entity_data_class/bdcmodel1/contact.vb" id="Snippet1":::

Related content