小编Mic*_*ann的帖子

如何基于条件退出PostSharp方面的OnEntry方法中的方法

我希望方面基于如下条件退出方法调用:

    [AttributeUsage(AttributeTargets.Method)]
    public class IgnoreIfInactiveAttribute : OnMethodBoundaryAspect
    {
        public override void OnEntry(MethodExecutionEventArgs eventArgs)
        {
             if (condition)
            {
                **// How can I make the method return here?**
            }
        }
    }
Run Code Online (Sandbox Code Playgroud)

任何帮助非常感谢.

c# aop postsharp

5
推荐指数
1
解决办法
1094
查看次数

标签 统计

aop ×1

c# ×1

postsharp ×1