LinqConnect Documentation
In This Topic
    Generating Code for the Model
    In This Topic

    In Entity Developer, code generation for the created model is managed through code generation templates.


    Template Types

    There are the following three types of templates in Entity Developer:

    Note:

    Prior to adding a predefined template with the Copy template to model folder check box selected, ensure that your model has been saved first. It is impossible to copy a template to an unsaved model.


    Available Templates

    The following templates are available in Entity Developer for LINQ to SQL:


    Definition of Generation Paths

    Using the properties of templates, available in Entity Developer, you can define paths to the folder, in which generated code for entities and contexts will be stored. The procedures for defining the paths are different, depending on whether you use the Microsoft Visual Studio add-in or the stand-alone application.


    How to Define Generation Paths in Visual Studio Add-In

    1. In the Model Explorer window, select the required template.
    2. Right-click the selected template and select Properties from the shortcut menu.
    3. To define the project and project folder for context generation files, click in the Context Output line of the Properties window and then click the three-dotted button that is displayed.
    4. In the Select Project Folder dialog box, navigate to specify the folder, in which the generated file(s) is (are) to be stored.
    5. To define the project and project folder for entities generation files, click in the Entities Output line of the Properties  window and then click the three-dotted button that is displayed.
    6. In the Select Project Folder dialog box, navigate to specify the folder, in which the generated file(s) is (are) to be stored. 
    Note:

    When defining the project and project folder, you can specify a project that is different from the current one.


    How to Define Generation Paths in the Entity Developer Stand-alone Application

    In the Entity developer stand-alone application, you can define destination folders for the generation of entities and contexts. For that purpose, perform the following steps:

    1. In the Model Explorer window, select the required template.
    2. Right-click the selected template and select Properties from the shortcut menu.
    3. To define the path for context generation files, click in the Context Output line of the Properties window and then click the three-dotted button that is displayed.
    4. In the Browse For Folder dialog box, navigate to specify the folder, in which the generated file(s) is (are) to be stored.
    5. To define the path for entities generation files, click in the Entities Output line of the Properties  window and then click the three-dotted button that is displayed.
    6. In the Browse For Folder dialog box, navigate to specify the folder, in which the generated entities file(s) is (are) to be stored.

     The advantage of this functionality is that you do not have to redefine these paths once the project is moved to another machine.


    Gode Generation

    The procedure for code generation differs depending on whether Entity Developer is used as a Visual Studio add-in or as a stand-alone application.