C # AOP method Intercepting calls to child methods?

The AOP (C #) implementation always intercepts the first (public) method call, but not the subsequent methods called in the first interception method, is this a limitation of the ContextBoundObject AOP implementation, or am I doing it wrong?

[InterceptMe]
public void MethodOne()
{
    MethodTwo();
}

[InterceptMe]
public void MethodTwo() 
{ 
   //not intecepted from MethodOne Call 
}

Any ideas?

+3
source share
1 answer

AFAIK, intercepting objects related to a context, works only to intercept calls at the context boundary. Since methodtwo lies in the same context as the methodone method, it does not cross the border and will not be intercepted.

+2
source

Source: https://habr.com/ru/post/1766257/


All Articles