Jon
Jon

Reputation: 4295

C# AOP Method Interception on child method calls?

My AOP (C#) implementation always intercepts the first (public) method call but not subsequent methods called within the first intercepted method, is this a limitation with ContextBoundObject AOP implementations or am I doing it wrong?

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

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

Any Ideas?

Upvotes: 3

Views: 619

Answers (1)

x0n
x0n

Reputation: 52420

AFAIK, context bound object interception only works for intercepting calls at a context boundary. Since methodtwo lies within the same context as methodone, it does not cross a boundary and will not be intercepted.

Upvotes: 2

Related Questions