Reputation: 5606
I've just built an EF model over a db (Framework 3.5 sp1), and I want to create a WCF Data Service to deploy it. No problem with the entities, but now I've created a service operation like this:
[WebGet]
public IQueryable<person> PersonsGetAll()
{
return this.CurrentDataSource.persons;
}
and I've setted in InitializeService
:
config.SetServiceOperationAccessRule("*", ServiceOperationRights.All);
So, if I try to call the operation by url, calling
http://localhost:1000/AKAdvService.AKAdvService/AKAdvDataService.svc/PersonsGetAll
it works fine, but when I add the reference to Visual Studio (2008) to this data service, I retrieve all the entities, but no operations. In the right panel of "Add Service Reference" I get the message:
"ADO.Net Data Service: No operations found."
What I'm missing?
Upvotes: 2
Views: 1846
Reputation: 13320
Currently the VS's Add Service Reference does not generate methods (nor does it actually understand) for service operations. To call a service operation which returns IQueryable the recommended way is to use something like:
context.CreateQuery<person>("PersonsGetAll");
If your service operation takes parameters you can add those by calling AddQueryOption on the result of the CreateQuery.
Upvotes: 2