How can we improve WCF Data Services?

AddQueryOption Method has a DataServiceVersion problem

DataServiceQuery<TElement>.AddQueryOption Method
http://msdn.microsoft.com/en-us/library/Cc646860(v=vs.103).aspx

When I call:
var ordersQuery = context.Orders.AddQueryOption("$filter", "Order_Details/any(od:od/UnitPrice gt 80M)").Include(o => o.Order_Details);
I get a DataServiceClientException:
The DataServiceVersion '1.0' is too low for the request. The lowest supported version is '3.0'.

But this works correctly:
var ordersQuery = context.Orders.Where(o => o.Order_Details.Any(od => od.UnitPrice > 80)).Include(o => o.Order_Details);

The any operator is new in OData V3. I use Microsoft.Data.Services 5.5.0.0.

I found this workaround, but for me this is not a solution because my filter condition must be dynamic:
http://social.msdn.microsoft.com/Forums/en-US/b39ac5c8-a41d-41b6-b8cb-159e84790d32/filling-dataservicecollection-with-sends-dataserviceversion-of-10

1 vote
Vote
Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
You have left! (?) (thinking…)
Marco shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

0 comments

Sign in
(thinking…)
Sign in with: facebook google
Signed in as (Sign out)
Submitting...

Feedback and Knowledge Base