Creating Domain Model
This article is relevant to entity models that utilize the deprecated Visual Studio integration of Telerik Data Access. The current documentation of the Data Access framework is available here.
In this step you will create a Telerik Data Access Class Library project which will hold the Domain Model of the Sofia Car Rental database.
- Open Visual Studio and from the FILE menu, select New and then Project...
From the New Project dialog, from within the Windows project templates, select Telerik Data Access Class Library template. In the Solution name field type QuickStartWinForms and name your project SofiaCarRental.Model. Click the OK button.
The New Domain Model Wizard will appear displaying the Select Telerik Data Access Domain Model Type screen. Select the Populate from database option. In the Model Name field enter SofiaCarRentalContext. Click the Next button.
You will be taken to the Setup Database Connection dialog. Use the Add New Connection button to configure the connection to your database. In the Connection String Name text-box type SofiaCarRentalConnection. Press the Next button.
Next is the Choose Database Items screen. Here you need to select the tables which will compose your model. Expand the Tables node and click on the checbox in front of it to select all tables from the database. Click the Finish button to complete the wizard.
Completing the New Domain Model Wizard will do the following:
- Add references to Telerik Data Access assemblies.
- Generates an .rlinq file which encapsulates the model of the database. The default name of the .rlinq file is in as Telerik Data Access Class Library project is EntitiesModel.rlinq.
- Creates an app.config file containing the defined connection string.
- Displays the Domain Model in the Telerik Data Access Visual Designer.
To finalize this step of the Quick Start,select the generated EntitiesModel.rlinq file and rename it to SofiaCarRentalModel.rlinq. Expanding the .rlinq file should now look like the picture below: