是否可以在WCF数据服务中设置全局拦截器

发布于 2025-01-02 05:34:36 字数 286 浏览 1 评论 0原文

我目前正在使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

疏忽 2025-01-09 05:34:36

有处理管道事件。 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文