public override void AddMethod <TRequest, TResponse>(Method <TRequest, TResponse> method, ClientStreamingServerMethod <TRequest, TResponse> handler)
        {
            var(invoker, metadata) = CreateModelCore <ClientStreamingServerMethod <TService, TRequest, TResponse> >(
                method.Name,
                new[] { typeof(IAsyncStreamReader <TRequest>), typeof(ServerCallContext) });

            _context.AddClientStreamingMethod <TRequest, TResponse>(method, metadata, invoker);
        }
Beispiel #2
0
        public void AddClientStreamingMethod <TRequest, TResponse>(
            Method <TRequest, TResponse> method,
            IList <object> metadata,
            Func <TService, IAsyncStreamReader <TRequest>, ServerCallContext, Task <TResponse> > handler)
            where TRequest : class
            where TResponse : class
        {
            var invoker = handler.Method.CreateDelegate <ClientStreamingServerMethod <TService, TRequest, TResponse> >(handler.Target);

            _context.AddClientStreamingMethod(method, metadata, invoker);
        }
 public override void AddMethod <TRequest, TResponse>(Method <TRequest, TResponse> method, ClientStreamingServerMethod <TRequest, TResponse> handler)
 {
     var(invoker, metadata) = CreateModelCore <ClientStreamingServerMethod <TService, TRequest, TResponse> >(
         method.Name,
         new[] { typeof(IAsyncStreamReader <TRequest>), typeof(ServerCallContext) });
     if (_isIGrpcService)
     {
         _context.AddClientStreamingMethod <TRequest, TResponse>(method, metadata, invoker);
     }
     AddMetaMethod((new MetaMethodModel
     {
         FullName = method.FullName,
         RequestType = typeof(TRequest),
         ResponseType = typeof(TResponse),
         ServiceType = typeof(TService),
         Handler = invoker
     }));
 }
 public override void AddMethod <TRequest, TResponse>(Method <TRequest, TResponse> method, ClientStreamingServerMethod <TRequest, TResponse> handler)
 {
     _context.AddClientStreamingMethod(method, Array.Empty <object>(), (_, request, context) => handler(request, context));
 }
Beispiel #5
0
 public override void AddMethod <TRequest, TResponse>(Method <TRequest, TResponse> method, ClientStreamingServerMethod <TRequest, TResponse> handler)
 {
     var(invoker, metadata) = CreateModelCore <ClientStreamingServerMethod <TService, TRequest, TResponse> >(method.Name);
     _context.AddClientStreamingMethod <TRequest, TResponse>(method, metadata, invoker);
 }