Telerik OpenAccess ORM

Telerik OpenAccess ORM Send comments on this topic.
Generating the SofiaCarRental Data Model
Programmer's Guide > OpenAccess ORM Classic (Old API) > Getting Started > QuickStart > Generating the SofiaCarRental Data Model

Glossary Item Box

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:

  1. Start a new project in your visual studio by choosing File->New->Project.
  2. On the pop up menu choose Class Library
    1. In the Name field write down OpenAccessData.
    2. In the Solution Name field write down: Quickstart.
    3. 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.
  3. From the Telerik menu, point OpenAccess and then Enable Project to use ORM...

    Enable Project to use ORM

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

    Persistantclasses Checkbox

  6. Click Next to continue.
  7. In the Database Name field write "SofiaCarRental1" and click Next.
  8. Click Finish.
For more information about the Enable Project wizard, read Enable Project Wizard.

 Generating Classes

To generate you classes:

  1. From the Telerik menu, point OpenAccess and then Reverse Mapping(Table to Classes)

    ReverseMaping

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

    MapColumn
  6. Do the same for Days property.
  7. Click Generate & Save Config.
  8. Click Yes.
For more information about the Reverse Mapping wizard, see Reverse Mapping Wizard.

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.