62,074
社区成员
发帖
与我相关
我的任务
分享
public partial class LogBehavior : IInterceptionBehavior
{
public IMethodReturn Invoke(IMethodInvocation input, GetNextInterceptionBehaviorDelegate getNext)
{
var result = getNext()(input, getNext);
// 获取异常
if (result.Exception != null)
{
// 异常不设置为空时,将会死循环调。
// 但设置为空时,异常不会向上抛出
// 我想达到的效果是向上抛出异常,求正解
result.Exception = null;
}