I'm looking for the full list of supported linq extension methods that are compatible with WCF Data Services.
By trial and error I've found First( Func ) and Single( Func ) aren't supported, any others?
This gives me a pretty good idea of whats supported, I just don't know whats actually translated via the IQueryProvider.
I've found a site listing the unsupported linq methods
http://msdn.microsoft.com/en-us/library/ee622463.aspx#unsupportedMethods
First and Single are not supported for Silverlight because Silverlight requires all networking be done async, but you can simulate it with code like this
NorthwindEntities context = new NorthwindEntities(new Uri("Northwind.svc", UriKind.Relative));
DataServiceQuery<Order> q = (DataServiceQuery<Order>)context.Orders.Take(1);
q.BeginExecute((IAsyncResult ar) =>
{
var o = ((DataServiceQuery<Order>)q).EndExecute(ar).First();
txtOutput.Text = o.OrderID.ToString();
}, null);
In this code you are requesting only one be sent over the network with the Take(1), and then once it is already on the client using First() or Single() to easily get the singleton reference.
There is no definitive list of supported Linq operators available that I know of.
-jeff
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With