My WCF Data Service includes this:
[WebGet]
public MyClass GetClass() { return new MyClass(); }
And this works just fine when I call it through REST.
However, I have a Service Reference in a Silverlight project and I want to call it.
I do this:
var _Context = new DatabaseContainer(new Uri("http://localhost:1234/Service.svc/"));
var _Results = new DataServiceCollection<MyClass>(_Context);
var _Query = _Context. ???
How do I access my GetClass() method?
Thanks.
It’s a ServiceOperation with a non-Queryable return type, so you need Execute it using your client.
http://msdn.microsoft.com/en-us/library/cc646700.aspx
Example:
http://blogs.msdn.com/b/astoriateam/archive/2010/05/26/service-operations-and-the-wcf-data-services-client.aspx