2
Answers

Silverlight and RIA Services - Problem geting all data from

Jorge Martins

Jorge Martins

10y
1.1k
1
I have this strange behavior on my Silverlight project working with RIA Services.
 
On my Data Model I have a master table (PRT_NEWS) with two foreign keys to two related tables (PRT_EXT_NEWS_ESTADOS and PRT_EXT_NEWS_IMAGENS).
 
Relationships between the master table and the related tables are done exactly the same way.
 
Domain service and Domain Service Metadata have the needed information done the same way.
 
The goal is to have a master Entity in the Silverlight project that has all the data from the master table and also the data from the related tables.
 
RIA is supposed to take care of this and exposes all data (master and related tables data) as a single entity.
 
In the Silverlight project data is loaded using a LoadOperation. Nothing fancy here.
 
When I stop execution and check what’s being returned on the entity collection I can see that all data from master table is there as all data from the first related table (PRT_EXT_NEWS_ESTADOS) but the entity that should hold the data from the second related table is always null.
 
Googling around I found some hints to try.
 
Tried “Lazy loading” to false.
Tried the [Include] decoration on the master table member that holds the related table entity.
Tried the .Include(“PRT_EXT_NEWS_IMAGENS”) on the Get method of the master table.
Even tried to change the order of member declaration in the metadata.
 
None of those worked and, surprisingly, the PRT_EXT_NEWS_ESTADOS member on the master table has nothing of this and works just fine.
 
Is there anyone familiar with this behavior? What was the solution or workaround?
 
Thanks
Answers (2)