Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的 AOP (C#) 实现总是拦截第一个(公共)方法调用,但不拦截第一个拦截方法中调用的后续方法,这是 ContextBoundObject AOP 实现的限制还是我做错了?
[InterceptMe] public void MethodOne() { MethodTwo(); } [InterceptMe] public void MethodTwo() { //not intecepted from MethodOne Call }
有任何想法吗?
AFAIK,上下文绑定对象拦截仅适用于在上下文边界拦截调用。由于methodtwo与methodone处于同一上下文中,因此它不会越界,也不会被拦截。