This is a migrated thread and some comments may be shown as answers.
Referential Integrity
1 Answer 17 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Randy Minder
Top achievements
Rank 1
Randy Minder asked on 01 Sep 2009, 12:29 AM
I am just learning how to use the ORM product. I created two classes, Customer and Territory. The Customer table has a foreign key column into the Territory table. IOW, the Customer table has a column named TerritoryID that points to a row in the Territory table. Telerik correctly created both tables and primary keys etc. However, how do I have it set up the RI between the Customer and Territory table?

Thanks - Randy

1 Answer, 1 is accepted

Sort by
0
Zoran
Telerik team
answered on 03 Sep 2009, 04:50 PM
Hello Randy Minder,

If we understood you right, by Referential Integrity you mean keeping the object graph in a consistent state. This is achievable by using the [Telerik.OpenAccess.Depend()] attribute. You can place it on the Territory property of the Customer class. That way, whenever you delete a Customer object, its related Territory will be deleted as well. If you had different idea in mind, please provide us with some more information so we can give you concrete answer for your specific scenario.

Best wishes,

Zoran
the Telerik team


Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
General Discussions
Asked by
Randy Minder
Top achievements
Rank 1
Answers by
Zoran
Telerik team
Share this question
or