private Object DefaultInvoke(Object[] parameters,
                              MethodAttributeContext context,
                              Func <MethodAttributeContext, Object> action)
 {
     context.SetParameters(parameters);
     return(action?.Invoke(context));
 }
Пример #2
0
        private Object PipeInvoke(MethodInfo method, Object[] parameters,
                                  MethodAttributeContext context)
        {
            context.SetParameters(parameters);
            OnExecuting(context);
            var resul = method.Invoke(ProxyInstance, parameters);

            OnExecuted(context);
            return(resul);
        }
 /// <summary>
 ///  if method return type is task<T>
 /// </summary>
 /// <returns></returns>
 public abstract Task <T> InvokeAsync <T>(MethodAttributeContext context);
 /// <summary>
 /// if method return type is task
 /// </summary>
 /// <returns></returns>
 public abstract Task InvokeAsync(MethodAttributeContext context);
 /// <summary>
 /// if method is sync
 /// </summary>
 /// <returns></returns>
 public abstract object Invoke(MethodAttributeContext context);
 public override void OnExecuted(MethodAttributeContext context)
 {
     OnExecutedAsync(context);
 }
 public abstract Task OnExecutedAsync(MethodAttributeContext context);
Пример #8
0
 public abstract void OnExecuted(MethodAttributeContext context);