Exemplo n.º 1
0
        public async Task <Response1> SendAsync <Response1>(GetService getService, object request)
        {
            var concreteHandler = getService(typeof(THandler));
            Func <THandler, TRequest, Task <Response1> > typedHandler = (h, req) => (Task <Response1>)(object) _method.Action((THandler)concreteHandler, (TRequest)(object)request !);

            return(await typedHandler((THandler)concreteHandler, (TRequest)(object)request !));
        }
Exemplo n.º 2
0
        public async Task <TResponse> SendAsync <TResponse>(GetService getService, object request, CancellationToken cancellationToken)
        {
            var concreteHandler = getService(typeof(THandler));
            Func <THandler, TRequest, CancellationToken, Task <TResponse> > typedHandler = (h, req, ct) => (Task <TResponse>)(object) _method.Action((THandler)concreteHandler, (TRequest)(object)request !, ct);

            return(await typedHandler((THandler)concreteHandler, (TRequest)(object)request !, cancellationToken));
        }
Exemplo n.º 3
0
        public Response1 Send <Response1>(GetService getService, object request)
        {
            var concreteHandler = getService(_method.HandlerType);

            return((Response1)(object)_method.Action((THandler)concreteHandler, (TRequest)request) !);
        }