服务操作和查询拦截器 [英] Service Operation and Query Interceptor

查看:121
本文介绍了服务操作和查询拦截器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我的DataService中有几个查询拦截器,我还有几个Serviceoperations来复制QueryInterceptors中的功能。是否可以让QueryInterceptors对ServiceOperations起作用?

我遇到的问题是,我有以下内容:[QueryInterceptor(" importdata")]拦截对importdata的请求,我也有一个WebGet方法(public IQueryable< CTIModel.importdata> GetData()),我也想对它使用QueryInterceptor。我也尝试了下面的拦截器(QueryInterceptor("GetData"))但是没有"拦截"拦截器。或者。所以我的整体问题是你可以通过QueryInterceptors获取ServiceInperations。

亲切的问候,
Paul Kinlan。


http://www.kinlan.co.uk/

Hi,

I have several query interceptors in my DataService, I also have several Serviceoperations that replicate functionality that is in the QueryInterceptors.  Is it possible to get QueryInterceptors to work against ServiceOperations?

The problem I have is, that I have the following: [QueryInterceptor("importdata")] which intercepts requests to importdata, I also have a WebGet method (public IQueryable<CTIModel.importdata> GetData()) and I would like to use QueryInterceptor against it also.  I have also tried the following interceptor (QueryInterceptor("GetData")) but that does not "intercept" either.

So my overall question is can you have ServiceOperations that get incercepted by the QueryInterceptors.

Kind Regards,
Paul Kinlan.


http://www.kinlan.co.uk/

推荐答案

您好Kinlan,

QueryInterceptors注册了整个EntitySets,每当EntitySet被调用访问可以通过数据服务的/ EntitySet端点或返回EntitySet的服务操作进行访问。
在上面的例子中,
将查询拦截器与[QueryInterceptor]相关联"importdata")应拦截对返回IQueryable< importdata>的服务操作的任何请求。 。在调用服务操作时,您是否看不到Query Interceptor?
Hi Kinlan,

 The QueryInterceptors are registered againts EntitySets  and are called whenever the EntitySet is accessed.

 The access can be through the /EntitySet endpoint of the Data Service or a Service Operation that returns the EntitySet.
 In the above case ,
Attributing the query interceptor with [QueryInterceptor("importdata")] should intercept any requests to the service operation which returns the IQueryable<importdata> . Do you not see the Query Interceptor hit when the service operation is called ?


这篇关于服务操作和查询拦截器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆