Understanding Query Interceptors

Query interceptors are public methods for intercepting HTTP GET requests and allow developers to handle the reading request. Such methods are decorated with the QueryInterceptor attribute that simply requires specifying the entity set name. For a better understanding, consider the following interceptor (to be implemented within the NorthwindService class) that returns only orders from the specified culture:

image

OnQueryOrders will be invoked on the service each time an HTTP GET requests is sent to the service. The code just returns only orders where the ShipCountry property’s value is Italy, if the client culture (the ...

Get Visual Basic® 2010 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.