Referential Integrity

Thread is closed for posting
2 posts, 0 answers
  1. Randy Minder
    Randy Minder avatar
    20 posts
    Member since:
    Aug 2009

    Posted 31 Aug 2009 Link to this post

    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
  2. Zoran
    Zoran avatar
    534 posts

    Posted 03 Sep 2009 Link to this post

    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,

    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.
Back to Top