I'd like the aspect to exit a method invocation based on a condition like the following:
[AttributeUsage(AttributeTargets.Method)]
public class IgnoreIfInactiveAttribute : OnMethodBoundaryAspect
{
public override void OnEntry(MethodExecutionEventArgs eventArgs)
{
if (condition)
{
**// How can I make the method return here?**
}
}
}
Any help much appreciated.
Ok I figured it out myself. Here the solution for the benefit of everyone: