Exemple #1
0
 public DiagnosticMetadataMiddleware(RequestDelegate next, IEnumerable <IDiagnosticPage> diagnosticPages, DiagnosticsMetadataOptions options)
 {
     _next            = next;
     _diagnosticPages = diagnosticPages;
     _url             = options.Url;
     _pageSerializer  = options.PageOutputSerializer;
 }
Exemple #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));
        }