创建自定义拦截器
拦截器需要 IInterceptor
接口。截获的类中的任何公共方法都将被截获 (包括 getter 和 setter)
public class MyInterceptor : IInterceptor
{
public void Intercept(IInvocation invocation)
{
//Calls the next method in the chain - The last one will be the
//original method that was intercepted
invocation.Proceed();
}
}