Exemplo n.º 1
0
        public static Middleware GetMethodDispatcher(Func <Type[], IMethodDispatcher> getProxy)
        {
            return(async(ctx, next) =>
            {
                Request request = CheckRequest(ctx);

                if (request.TypeArguments.Any())
                {
                    IMethodDispatcher proxy = getProxy(request.TypeArguments.ToArray());
                    await proxy.Dispatch(ctx, next);
                }
                else
                {
                    await next();
                }
            });
        }
Exemplo n.º 2
0
 public ContractInterceptor(IMethodDispatcher methodDispatcher)
 {
     _methodDispatcher = methodDispatcher;
 }
 public ContractProxyGenerator(IProxyGenerator proxyGenerator, IMethodDispatcher methodDispatcher)
 {
     _proxyGenerator   = proxyGenerator;
     _methodDispatcher = methodDispatcher;
 }