In this task, you will add references to the required assemblies and connection string information in the CarRentWebSite project.
Adding References in the CarRentWebSite Project
- In Solution Explorer, right-click the CarRentWebSite project and select Add Reference. This displays the Add Reference dialog box. Add a reference to the following Telerik OpenAccess ORM assemblies:
- Telerik.OpenAccess.dll
- Telerik.OpenAccess.35.Extensions.dll
Again, in Solution Explorer, right-click the CarRentWebSite project and select Add Reference. In the Add Reference dialog, navigate to the Projects tab page, select CarRentWebSite.OpenAccess and press OK.
In Solution Explorer, expand the References node for the CarRentWebSite project. Select the Telerik.OpenAccess.dll assembly, press F4 to open the Properties pane and set the Copy Local property to True.
Adding Connection String Information in the Main (CarRentWebSite) Project
The last step is to ensure that the client project "has" the ability to know about the domain model, i.e. to have an access to the database connection string used by the rlinq file. What you normally do when you have an existing config file in the client project is to copy the connection string from the App.config in the library project and paste it in the <connectionStrings/> section in the client config file:
- Open the App.Config file in the SofiaCarRentalLibrary project.
- Copy the connection string.

- Open the Web.Config file in the CarRentWebSite project and paste the connection string in the <connectionStrings/> section.
| XML |
Copy Code |
|
<?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> </configSections> <connectionStrings>
<add name="SofiaCarRental21Connection" connectionString="data source=.\sqlexpress;initial catalog=SofiaCarRental21;integrated security=True" providerName="System.Data.SqlClient" />
</connectionStrings> <!--More configurations--> </configuration> |
At this point the model is fully configured. Next, you will learn how to handle the OpenAccessContext in web applications.