public DiagnosticPageMiddleware(RequestDelegate next, IEnumerable <IDiagnosticPage> diagnosticPages, DiagnosticsOptions options)
 {
     _next            = next;
     _diagnosticPages = diagnosticPages;
     _options         = options;
 }
예제 #2
0
        public static IApplicationBuilder UseDiagnostics(this IApplicationBuilder builder, DiagnosticsOptions options, DiagnosticsMetadataOptions metadataOptions)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            return(builder
                   .Use(next => new DiagnosticPageMiddleware(next, builder.ApplicationServices.GetServices <IDiagnosticPage>(), options).Invoke)
                   .Use(next => new DiagnosticMetadataMiddleware(next, builder.ApplicationServices.GetServices <IDiagnosticPage>(), metadataOptions).Invoke));
        }