I have an entity model.
I am using DbContext generator to create the entities.
I have a WCF Data Service which exposes these entities.
I have a silverlight project with a service reference to the WCF Data Service.
If, from the silverlight, I use a query like this:
var qry = from l in svc.Locations.Expand("Attractions") select l;
I can see a correctly formatted OData query in fiddler however, the Attractions list is not populated in the returned feed.
If I do exactly the same but, instead of using DbContext I use the default entity generator, I again see an identical OData query in fiddler, but the response does include the Attractions.
Every example I have found for DbContext uses Include to load navigation properties instead of Expand. As far as I can tell, Include is not valid in an OData query.
Any ideas why the service doesn't return the "expanded" entities?
Is it something to do with the
this.Configuration.ProxyCreationEnabled = false;
line of code I have in the DbContext sub class on the server?
Any help greatly appreciated.
You can ask the question on http://visualstudiogallery.msdn.microsoft.com/7812b04c-db36-4817-8a84-e73c452410a2, as it is a problem with DbContext generator. In addition, even if it is a general OData issue, the correct forum is: http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataservices/threads/.
Thankyou for Replying.
However, I'm not using RIA services.
This issue is summed up in this quote:
Which I found in this, very helpful, article : http://social.technet.microsoft.com/wiki/contents/articles/5234.aspx