Sync relational model data

The LLBLGen Pro designer contains a central place where relational model data and entity model data are synchronized with each other: the Sync tab.

It is used for both synchronizing the entity model with an updated database schema in your database (Database first) as well as synchronizing your relational model data in your project with an updated entity model (Model first). In this tutorial we'll be using the latter, we'll using Sync to create a catalog, schema and tables from our entity model with one action.

Creating the relational model data using Sync

  • Start the LLBLGen Pro designer. Either use the Programs start menu, Windows search or double click the LLBLGenPro.exe in the installation folder to start the LLBLGen Pro designer.
  • To open our tutorial project, select it from the Recent Projects list on the Home Tab, or select File -> Open Project... from the main menu, or select the project from the File -> Recent Projects... menu.
  • From the menu select Project -> Sync Relational Model Data or press F5. The Sync tab opens.
  • As the project contains an empty relational model data container, there is no catalog yet and the Sync tab enlists the SQL Server element with as sync source Model. This is the default for when you add a new empty relational model data container, and also what we need, as we'll sync the SQL Server container with the entity model. In the list of Available Sync Tasks, there's one, enabled sync task created for you. To perform it, simply click the Perform Tasks.. button.
  • The Designer will now create a catalog (database) named after the project name, a schema after the group the entities are in (which is the empty group, so the default schema is created, 'dbo'), and for each entity a table. All relationships are converted to FK constraints as well. To examine what's been created, go to the Catalog explorer and navigate the tree to see which elements are created. Right-click a parent node and press Ctrl-Shift-D to open the details pane for its child nodes.
  • Additionally, Sync has created for each entity a mapping onto the table created from it. Verify this by opening an entity in its editor (Right-click the entity and select Edit...) and go to the Field Mappings tab at the bottom of the entity editor.

Validating your project

The LLBLGen Pro Designer will validate your project in real time in the background. If it detects an error or warning, it will notify you in the Errors & Warnings pane docked at the bottom. You can also validate the project manually by selecting from the menu Project -> Validate or by pressing F6. If you run into an error, you can expand the error in the Errors & Warnings pane to show the suggestions and quick-fixes the designer gives you.

  • Click the Errors & Warnings pane to make it visible if it's docked away.
  • It's likely there's an error, like the following: "The target framework specific setting 'ProviderManifestTokenValue' hasn't been set to a valid value. This value is required by the Entity Framework at runtime."
  • Expand this error in the Errors & Warnings pane by clicking the [+] button in front of it.
  • The error has a correction/suggestion node, which says: "Choice 1: Open the Project Settings and click the 'Entity Framework' node in the tree at the left. At the right, specify a value for the setting 'ProviderManifestTokenValue'"
  • Each suggestion has a handy link to go to the source of the error/warning, visible as the Go there link. Click the Go there link.
  • It opens the Project settings dialog. Navigate to Conventions->Entity Model->Entity Framework v6 and click Entity Framework v6. On the right, in the Provider manifest token setting, specify the database token, e.g. 2008 or 2012.
  • Click OK to close the settings dialog.
  • Go back to Errors & Warnings and verify the error is now gone.

Next step

This relational model data is not in your database server yet. It's only in your project. In the next step we'll export the created elements as a DDL SQL script so we can create the database physically in our database server: Create DDL SQL Script.