Create Table Associations Across Entity Modals

2 posts, 0 answers
  1. Andrew
    Andrew avatar
    124 posts
    Member since:
    Sep 2008

    Posted 26 Feb 2015 Link to this post

    I have create a DLL that contains 2 entity modals one called Student, the other called Course to keep my modals clean.

    What I want to know is can I create an association between a table in the student modal and a table in the Course modal so when using the modal in and applications I write you will not be able to tell that the tables are across 2 different modals.

    eg: student.Cources.GetActive()

  2. Doroteya
    Doroteya avatar
    498 posts

    Posted 02 Mar 2015 Link to this post

    Hi Andrew,

    Thank you for contacting us.

    Currently, Telerik Data Access cannot create associations between entities that reside in two different .rlinq files, but as long as the database behind the two models is one and the same, with another feature of ours you can achieve both the logical separation and the association. Following are the details:

    The Multiple Diagrams feature allows you to split a single .rlinq file into more than one diagram - in your case all the entities relevant to Student can reside in one diagram and all tables relevant to Course can reside in another. The multiple diagrams can be created either during the generation of the model or afterwords, when you decide that you need the logical separation. 

    As for a workflow you could apply, I would suggest to you the following guidelines:
    1. Create a single .rlinq file and in it add the entities for both Student and Course - the recommended way to achieve this is by reverse mapping the database, but if this is not an option you could manually merge the XML representation of the .rlinq files.
    2. Create the necessary association.
    3. Split the model to multiple diagrams in Visual Designer.

    I hope this helps. Do let us know, if you need additional information or assistance.

    OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
  3. DevCraft banner
Back to Top