如何使用通用组件安装(方法)拦截器
给出以下代码:
container.Register(
AllTypes.FromAssemblyNamed("MyNameSpace")
.Where(component => component.Name.EndsWith("Repository"))
.WithService.FirstInterface()
.Configure(component => component.LifeStyle.Singleton)
);
是否可以为找到的所有组件引入拦截器(例如 LoggingInterceptor)?我现在唯一的办法是破坏每个组件并显式添加拦截器,我发现这违反直觉,因为他们将使用一个拦截器(即 LoggingInterceptor)。
谢谢
Given the following code:
container.Register(
AllTypes.FromAssemblyNamed("MyNameSpace")
.Where(component => component.Name.EndsWith("Repository"))
.WithService.FirstInterface()
.Configure(component => component.LifeStyle.Singleton)
);
Is it possible to introduce an Interceptor(eg LoggingInterceptor) for all components found? My only recourse now is to break each components and add the Interceptor explicitly, which I found counter intuitive since they'll be using one interceptor(ie LoggingInterceptor).
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)