I'm trying out the WCF Data Services in .NET with .FirstOrDefault() on the returned Queryable. But when checking with Fiddler it's still returning the whole set of objects. I have to do something wrong?
The code is really basic:
[OperationContract]
IQueryable<Note> Query();
[WebGet(UriTemplate = "")]
public IQueryable<Note> Query()
{
return _source.OfType<Note>().AsQueryable<Note>();
}
Note note = _client.Query().FirstOrDefault();
This will still yield and transfer all notes over the network.
What have I missed?
Can I even use IQueryable and "remote LINQ" with a normal WCF Web Service?
I've found some examples where they were using a DataService(T) and a DataServiceContext locally as a client. I did try that to but I never got it to work at all.
The only thing I need is this "remote LINQ"-feature so I can query my web service via LINQ and not respond with all items when only, for instance, the first was requested.