是否可以在WCF数据服务中设置全局拦截器
我目前正在使用 ChangeInterceptor 来拦截对我的实体的更改。这太棒了,它允许我进行大量的日志记录。
[ChangeInterceptor("Products")]
public void OnChangeProducts(Product product, UpdateOperations operations)
...
我想知道 WCF 中是否有类似的拦截器概念,以便我可以测量查询执行的性能。简而言之(不使用 AOP),如何拦截调用的开始和结束?
谢谢!
I am currently using ChangeInterceptor to intercept changes to my entites. This is great and it allows me to do extensive logging.
[ChangeInterceptor("Products")]
public void OnChangeProducts(Product product, UpdateOperations operations)
...
I was wondering if there is a similar concept of interceptors in WCF so that I could measure the performance of the execution of a query. In brief (without using AOP), how can I intercept the begin and end of a call?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有处理管道事件。 http://msdn.microsoft.com/en-us/library/ee474212.aspx 。
您可以为这些事件注册一个处理程序,它们将在每个请求处理的开始和结束时触发。
There are processing pipeline events. http://msdn.microsoft.com/en-us/library/ee474212.aspx.
You can register a handler for those events and they will fire at the beging and end of each request processing.