public DebugMiddleware(RequestDelegate next, DebugMiddlewareOptions options) { this.next = next; this.options = options; if (options.OnIncomingRequest == null) { options.OnIncomingRequest = ctx => Debug.WriteLine("Incoming request " + ctx.Request.Path); } if (options.OnOutgoingRequest == null) { options.OnOutgoingRequest = ctx => Debug.WriteLine("Outgoint request " + ctx.Request.Path); } }
public static IApplicationBuilder UseDebugMiddleware(this IApplicationBuilder builder, DebugMiddlewareOptions options) { return(builder.UseMiddleware <DebugMiddleware>(options)); }