using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Unity.Interception.PolicyInjection.Pipeline; namespace Txgy.EWS.Client.Log.Aop.Attributes { public class LogBeforeHandler : ICallHandler { LogHelper LogHelper = new LogHelper(); public int Order { get; set; } public IMethodReturn Invoke(IMethodInvocation input, GetNextHandlerDelegate getNext) { IMethodReturn methodReturn = null; // 保存日志 LogHelper.Debug(input.Target, "LogBeforeHandler Hello"); methodReturn = getNext().Invoke(input, getNext);// 方法体 return methodReturn; } } }