protected override async Task HandleCallAsyncCore(HttpContext httpContext, HttpContextServerCallContext serverCallContext)
        {
            // Decode request
            var request = await httpContext.Request.BodyReader.ReadSingleMessageAsync <TRequest>(serverCallContext, MethodInvoker.Method.RequestMarshaller.ContextualDeserializer);

            var streamWriter = new HttpContextStreamWriter <TResponse>(serverCallContext, MethodInvoker.Method.ResponseMarshaller.ContextualSerializer);
            await _invoker.Invoke(httpContext, serverCallContext, request, streamWriter);
        }
Esempio n. 2
0
        protected override async Task HandleCallAsyncCore(HttpContext httpContext, HttpApiServerCallContext serverCallContext)
        {
            // Decode request
            var request = await JsonRequestHelpers.ReadMessage <TRequest>(serverCallContext, SerializerOptions);

            var streamWriter = new HttpContextStreamWriter <TResponse>(serverCallContext, SerializerOptions);

            try
            {
                await _invoker.Invoke(httpContext, serverCallContext, request, streamWriter);
            }
            finally
            {
                streamWriter.Complete();
            }
        }