Custom logical and proxy classes in ADO.NET Data Services

I just read " " Entering Custom Logic into ADO.NET Data Services "and my next question is:" How do you get [WebGet]proxies to display in client classes? Of course, I can call it directly (RESTfully) with, say, WebClientbut I thought that the powerful input functions in ADO.NET Data Services would "hide" it from me automatically in a magical way.

So here we have:

public class MyService : DataService<MyDataSource>
{
    // This method is called only once to initialize service-wide policies.
    public static void InitializeService(IDataServiceConfiguration config)
    {
        config.SetEntitySetAccessRule("Customers", EntitySetRights.AllRead);
        config.SetServiceOperationAccessRule("CustomersInCity", ServiceOperationRights.All);
    }

    [WebGet]
    public IQueryable<MyDataSource.Customers> CustomersInCity(string city)
    {
        return from c in this.CurrentDataSource.Customers
               where c.City == city
               select c;
    } 

}

How can I get CustomersInCity()to display in my tasks on the client side?

+3
source share

Source: https://habr.com/ru/post/1743421/


All Articles