Ado.net staging resource in Silverlight

We are using Silverlight 2 with ADO.NET dataservices and to validate the Silverlight page we used a service on the same domain which works fine. We then decided to try using a proxy or staging service (sitting in the same domain as the Silverlight application) that basically just covers a service sitting in a different domain (using a class generated in a service link of a service in a different domain like a type exposed in our local service and creating a constructor that sets the Uri to point to). We wanted to do this the way we would like our Silverlight server to be in the DMZ and our service on an internal domain, since we will be using this service for internal applications, and this is similar to the Silverlight cross-domain constraint path.

This works great when we use the following request:

var questions = (from q in context.Question
                            select q)

      

But as soon as we try to use an extension like in:

var questions = (from q in context.Question.Expand("Answers")
                            select q)

      

we get an exception:

Can only set query parameters (orderby, where, take, skip) after the last projection.

Where is the stack trace:

at System.Data.Services.WebUtil.GetRequestEnumerator (IEnumerable enumerable) at System.Data.Services.DataService 1.SerializeResponseBody(RequestDescription description, IDataService dataService) at System.Data.Services.DataService

1.HandleNonBatchRequest (RequestDescription description) at System.Data.Services.DataService`1.HandleRequest ()

Does anyone have any suggestions as to the reason for this? This works fine on the backend, but I would think that since the request is composite, this would work on the proxy too ...

Any help would be greatly appreciated!

+1


source to share


1 answer


We were able to work around this problem by using the LoadProperty method on the client side. To get us all the questions, then call LoadProperty ("Answers") and questions.



+1


source







All Articles