public async Task <TAdvice> Handle(Func <Task <TAdvice> > next, ISolidProxyInvocation <TObject, TMethod, TAdvice> invocation)
 {
     // increase the step count.
     invocation.SetValue(StepCountKey, invocation.GetValue <int>(StepCountKey) + 1);
     if (invocation.IsLastStep)
     {
         return((TAdvice)(object)invocation.GetValue <int>(StepCountKey));
     }
     else
     {
         return(await next());
     }
 }
예제 #2
0
            public Task <IList <string> > Handle(Func <Task <IList <string> > > next, ISolidProxyInvocation <TObject, IList <string>, IList <string> > invocation)
            {
                var handlers = invocation.GetValue <IList <string> >("handlers");

                if (handlers == null)
                {
                    invocation.SetValue("handlers", handlers = new List <string>());
                }
                handlers.Add(GetType().Name);
                if (invocation.IsLastStep)
                {
                    return(Task.FromResult(handlers));
                }
                else
                {
                    return(next());
                }
            }
 public async Task <TAdvice> Handle(Func <Task <TAdvice> > next, ISolidProxyInvocation <TObject, TMethod, TAdvice> invocation)
 {
     invocation.SetValue("security_checked", true);
     return(await next());
 }