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