Cannot expose service method in ADO.NET data service

Asked
Viewd286

1

I am trying to create a method that can be exposed through an ADO.NET data service. No matter what I do, the client cannot see the method that I am exposing. I am out of ideas. Please help:

    [WebGet]
    public ObjectResult<Product> GetAllProducts()
    {
        ProductOrdersEntities entities = new ProductOrdersEntities();
        return entities.GetAllProducts();
    }

I have also kept access open to the methods:

    public static void InitializeService(IDataServiceConfiguration config)
    {
        config.SetEntitySetAccessRule("*", EntitySetRights.All);
        config.SetServiceOperationAccessRule("*", ServiceOperationRights.All);
    }

Still, when I create a client proxy, it cannot see the method GetAllProducts().

1 ответов

1

I was told by a developer in the Astoria team that the current code generation tool does not support generating code for service operations. By that time I had already started using the .Execute method to make an explicit HTTP request to invoke the method, and this strategy works fine; just that it is not elegant or typesafe.