public static IApplicationBuilder UseGlobalHttpContext(this IApplicationBuilder app)
        {
            var httpContextAccessor = app.ApplicationServices.GetRequiredService <IHttpContextAccessor>();
            var serviceScopeFactory = app.ApplicationServices.GetRequiredService <IServiceScopeFactory>();

            HttpContextProvider.ConfigureAccessor(httpContextAccessor, serviceScopeFactory);
            return(app);
        }