// IMyScopedService is injected into Invoke
        public async Task Invoke(HttpContext httpContext, IScopedRequestHook userHook)
        {
            bool proceed = true;
            await userHook.OnPreEndpointRequestAsync(httpContext, out proceed);

            if (!proceed)
            {
                return;
            }
            await _next(httpContext);

            await userHook.OnPostEndpointRequestAsync(httpContext);
        }
 public EndpointWatcherHookMiddleware(RequestDelegate next, IScopedRequestHook userHook)
 {
     _next = next;
 }