Many to many, Ria services and MVVM

2 posts, 0 answers
  1. Øystein
    Øystein avatar
    2 posts
    Member since:
    Dec 2010

    Posted 17 Jan 2011 Link to this post


    We have a database that we have created a entity model for and exposing to the client with a domain service. However I have now a problem that I need some help with or guidance.

    We have three entities that are related, but there is no relationships in the database... However in table1 we have our ingredients with its data and in another table we have a set of classifications an ingredient can have based on the users language. This is a many to many relation where we have a table that connects this.



    First of all I want to return all Codes that are connected to a given Ingr_no and populate them into a ObservableCollection.

    Is there a way of exposing the entities for this so that I can use datacontexts CRUD operations or do I need to write a DTO for this?


  2. PetarP
    PetarP avatar
    754 posts

    Posted 20 Jan 2011 Link to this post

    Hello Øystein,

     Basically what you need to do is to map the link table to a persistent type. This way you will be able to expose that link table to the service and using the Association Attributes you will be able to add 1:N relations to the link table from your other two entities. This will make the required information available in your two classes.
    Is this what you are trying to achieve or you had something else in mind?

    the Telerik team
    Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
  3. DevCraft banner
Back to Top