//public static IApplicationBuilder UseServiceRequestLoggingMiddleware(this IApplicationBuilder app)
        //{
        //    if (app == null)
        //        throw new ArgumentNullException(nameof(app));
        //    return app.UseServiceRequestLoggingMiddleware((Action<ServiceRequestLoggingMiddlewareConfiguration>)(config => { }));
        //}

        public static IApplicationBuilder UseServiceRequestLoggingMiddleware(this IApplicationBuilder app,
                                                                             ServiceRequestLoggingMiddlewareConfiguration config)
        {
            if (app == null)
            {
                throw new ArgumentNullException(nameof(app));
            }
            if (config == null)
            {
                throw new ArgumentNullException(nameof(config));
            }

            return(app.UseMiddleware <ServiceRequestLoggingMiddleware>((object)config));
        }
 public ServiceRequestLoggingMiddleware(RequestDelegate next,
                                        ServiceRequestLoggingMiddlewareConfiguration config)
 {
     _next   = next;
     _config = config;
 }