private JrpcContext ConvertToContext(IDictionary <string, object> environment)
        {
            OwinFeatureCollection collection = new OwinFeatureCollection(environment);

            var context = new JrpcContext {
                JrpcRequestContext  = new KestrelJrpcRequestContext(collection, collection),
                JrpcResponseContext = new KestrelJrpcResponseContext(collection)
            };

            return(context);
        }
        private JrpcContext ConvertToContext(IOwinContext context)
        {
            if (context == null)
            {
                return(null);
            }

            var jrpcContext = new JrpcContext
            {
                JrpcRequestContext  = new OwinJrpcRequestContext(context.Request),
                JrpcResponseContext = new OwinJrpcResponseContext(context.Response)
            };

            return(jrpcContext);
        }