Ria Services loading foreign keys with Linq-to-SQL

Posted by Stephan on Stack Overflow See other posts from Stack Overflow or by Stephan
Published on 2010-03-31T15:57:01Z Indexed on 2010/04/20 21:23 UTC
Read the original article Hit count: 252

I have a database that consists of 5 tables : Course, Category, Location, CourseCategories, and CourseLocations. The last 2 tables just contain the two foreign keys. A Course has many-to-many relationships with both category and location.

I am trying to load the data into a Silverlight app using Ria Services. My DB model is Linq-to-SQL. I have tried adding the [Include] attribute to the metadata classes and I have added the DataLoadOptions so it should load the all tables when you ask for a Course. However on the client side I am never getting back any entries in the CourseCategories and CourseLocations properties.

What else needs to be done to get the foreign key relationships to exist across the serialization.

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about ria-services