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

JoinTableAssociation

1 Answer 56 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Will Vandergrift
Top achievements
Rank 1
Will Vandergrift asked on 26 Jan 2011, 05:03 PM
I'm in the process of converting a project over from another ORM to OpenAccess. The project is a WCF RIA Silverlight app that connects to a database that uses several join tables.

The problem, that I'm running into, is how to expose properties that are related via join tables. I've attached an image that shows two tables that are associated in the database via a join table.

I found documentation about the JoinTableAssociationAttribute but haven't been able to use it to expose a ProcessStandards property in my class.

private IList<ProcessStandard> processStandards = new List<ProcessStandard>();
 
[JoinTableAssociation(TableName = "LessonProcessStandards", OwnerColumns = "ID", TargetColumns = "PSID")]
public virtual IList<ProcessStandard> ProcessStandards
{
    get
    {
        return this.processStandards;
    }
}

I apologize if this is a simple problem, but so far I've been unable to figure it out browsing through the forums or documentation. Thanks for the help.

Will

1 Answer, 1 is accepted

Sort by
0
PetarP
Telerik team
answered on 27 Jan 2011, 03:58 PM
Hi Will Vandergrift,

 WCF RIA data services does not support Many-to-Many relationships out of the box. This is not a limitation that is implied by us but by RIA data services itself.
The only possibility as for now is to reverse map your join table and use it as a real entity. This way you will be able to do a 1:N associations from your two other entities to the join table itself.

All the best,
Petar
the Telerik team
Accelerate your learning with industry's first Telerik OpenAccess ORM SDK. Download today.
Tags
Getting Started
Asked by
Will Vandergrift
Top achievements
Rank 1
Answers by
PetarP
Telerik team
Share this question
or