In this task you will learn how to make a data model from already existing database. This model is used for the rest of the tasks listed in this quickstart guide.
Enabling OpenAccess Project
To enable your project to use Telerik OpenAccess ORM:
- Start a new project in your visual studio by choosing File->New->Project.
- On the pop up menu choose Class Library
- In the Name field write down OpenAccessData.
- In the Solution Name field write down: Quickstart.
- Click OK to generate the project.
 |
Note that Web projects cannot contain persistent classes. It is required that the persistent model is buildable to an assembly file, so it can be enhanced by the VEnhance program of Telerik OpenAccess ORM. For more information, see Using VEnhance. |
From the Telerik menu, point OpenAccess and then Enable Project to use ORM...

Click Next.
Check the Persistent classes checkbox and leave Data Access code (DAL) option unchecked.

Click Next to continue.
In the Database Name field write "SofiaCarRental1" and click Next.
Click Finish.
Generating Classes
To generate you classes:
- From the Telerik menu, point OpenAccess and then Reverse Mapping(Table to Classes)

- The Reverse Mapping Wizard appears.
- Click on Advanced View (Treeiew) tab page.
- Expand the RentalOrders class and find the OrdarTotal property.
- Uncheck Map column option for that property.

- Do the same for Days property.
- Click Generate & Save Config.
- Click Yes.
Next Step
You have successfully generated the mapping files and class definitions for the SofiaCarRental database in the quickstart guide. Next, you will create the ASP.NET client application. See Creating the CarRentalAgency Application.