//using AspectCore.DynamicProxy; ////using System; //using System.Collections.Generic; //using System.Linq; //using System.Reflection; //using System.Text; //using System.Threading; //using System.Threading.Tasks; //namespace Store.Framework.Attributes //{ // /// // /// Aop延迟时间 // /// // /// // public class SleepAttribute : AopInterceptorAttribute // { // /// // /// 毫秒 // /// // public int Millisecond { get; set; } // /// // /// 间隔区间 // /// // public Tuple ExtentMillisecond { get; set; } // /// // /// 执行位置 // /// // public ExecOrder Location { get; set; } = ExecOrder.Before; // public SleepAttribute(int millisecond) // { // Millisecond = millisecond; // } // public SleepAttribute(int StartMillisecond, int EndMillisecond) // { // ExtentMillisecond = new Tuple(StartMillisecond, EndMillisecond); // } // public override void BeforeAction(AspectContext context) // { // if (Location == ExecOrder.Before) // Exec(); // } // public override void AfterAction(AspectContext context) // { // if (Location == ExecOrder.After) // Exec(); // } // private void Exec() // { // if (ExtentMillisecond != null) // { // Millisecond = new Random().Next(ExtentMillisecond.Item1, ExtentMillisecond.Item2); // } // Thread.Sleep(Millisecond); // } // public enum ExecOrder // { // /// // /// 方法执行前 // /// // Before, // /// // /// 方法执行后 // /// // After // } // } //}