This is a migrated thread and some comments may be shown as answers.

Many to many, Ria services and MVVM

1 Answer 69 Views
LINQ (LINQ specific questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Øystein
Top achievements
Rank 1
Øystein asked on 17 Jan 2011, 04:12 PM
Hi.

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.

Classification_table
Id(key)
Language(key)
Description
Code

LinkTable:
ID(key)
Ingr_no(key)

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?

Regards

Øystein

1 Answer, 1 is accepted

Sort by
0
PetarP
Telerik team
answered on 20 Jan 2011, 06:09 PM
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?

Regards,
Petar
the Telerik team
Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
Tags
LINQ (LINQ specific questions)
Asked by
Øystein
Top achievements
Rank 1
Answers by
PetarP
Telerik team
Share this question
or