Data Access has been discontinued. Please refer to this page for more information.

Manage Navigation Properties Overview

Being an object - relational mapper, Telerik Data Access allows you to perform CRUD operations on your database tables with the help of object oriented concepts. From this point of view, Telerik Data Access models the constraints between the tables with the help of the so called navigation properties.

Generally, a persistent class contains fields and properties that match by name and value type the columns in a corresponding database table. In addition to these fields and properties, the persistent class may have navigation ones if the table it is mapped to, participates in a relationship. For example, the Categories and RentalRates tables (the SofiaCarRental sample database) are in a one-to-many relationship, where the Categories table is the parent table and RentalRates is the child table:

To map this relationship in the model, the Category class has IList<RentalRates> RentalRates which basically is a list of all rental rates that belong to a given category, while the RentalRate class has Category Category which is a reference to the category for every rental rate. An example with the code of the classes is available in the Creating The SofiaCarRental Model article.

These navigation properties allow you to easily access in your code the parent object of a given child object and the collection of child objects of a given parent.

Apart from accessing the objects on the other side of the association, the navigation properties can help you to insert, update and delete related objects in the database. For that purpose, the relationship between them has to be handled in a certain manner - it should be marked as managed through the IsManaged method in the mapping configuration.

IsManaged instructs Telerik Data Access to track additions and removals of items in the collection navigation properties and to issue the proper statements during SaveChanges().

Setting one-to-many and many-to-many associations as managed could lead to decreased performance when working with large databases, containing hundreds of thousands of objects participating in such relationships.

This section will provide you with the necessary information about how to use IsManaged according to the type of the relationship that two database tables can share: