Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
I have a Silverlight 4.0 application that has a normalised database. In this database i have tables for Applicants, Licences, LicenceClasses, LicenceTypes and LicenceStatuses amongst others. The last 3 mentioned tables are lookup tables linked to the Licences table through foreign key relationships.I am using RIA services with the Entity Framework for data access. The scenario i am facing is as follows. When i create a datagrid on my form i get all the appropriate colums with fields from the Licences table. I want to display the names from the lookup tables that are represented by the ID fields in the Licence table. I need to show for instance the LicenceStatus instead of the LicenceStatusID.

I have followed some examples about including the related collections in my domain service and making all the appropriate Include annotations in the Metadata classes. While i can correctly get this to work with one lookup field , i can't seem to find a way to include more than one look up table in my GetLicences query.


public IQueryable<LearnersLicence> GetLearnersLicences()
{
   return this.ObjectContext.LearnersLicences.Include("LicenceClass");
}


In the above query i can only include the LicenceClass collection and i have found no way of including the LicenceStatus collection or multiple look up collections that i need to display. How do i go about accomplishing this?
Posted
Updated 30-Mar-11 4:05am
v2
Comments
HimanshuJoshi 30-Mar-11 10:06am    
Corrected pre tags and removed them around text.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900