I am using WCF Data Services and RavenDB.
Everything seemed to work very nicely until I came up with one thing: querying by ID.
Either this way:
/DataService.svc/EntitySet?$filter=ID eq '123'
Or:
/DataService.svc/EntitySet('123')
When I try to make a call to either of these urls, I get this:
Attempt to query by id only is blocked, you should use call session.Load("123");
instead of session.Query().Where(x=>x.Id == "123");
You can turn this error off by specifying
documentStore.Conventions.AllowQueriesOnId = true;
but that is not recommend and provided for backward compatibility reasons only.
How can I interrupt WCF Data Service to make a custom call to database instead of a default one with session.Query()?
As far as I know, Query interceptors will not work, because they need to have a particular EntitySet defined.