我有一个类来拦截DataException,它实现了IInterceptor接口,但是没有调用intercept方法。
我以这种方式注册拦截器类:
container.Register(Component.For<DatabaseErrorInterceptor>().LifestyleTransient());下面是拦截器类:
public class DatabaseErrorInterceptor : IInterceptor
{
public void Intercept(IInvocation invocation)
{
try
{
invocation.Proceed();
}
catch (DataException exc)
{
throw this.MapearExcecao(excecao);
}
}
private BusinessRuleException HandleException(DataException databaseError)
{
// ...
return new BusinessRuleException(...);
}
}发布于 2013-12-03 15:17:03
我们找到了这个问题的答案,它错过了打给container.Kernel.ProxyFactory.AddInterceptorSelector(...);的电话
https://stackoverflow.com/questions/20332416
复制相似问题