Пример #1
0
        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);
            }
        }
Пример #2
0
 public static IApplicationBuilder UseDebugMiddleware(this IApplicationBuilder builder, DebugMiddlewareOptions options)
 {
     return(builder.UseMiddleware <DebugMiddleware>(options));
 }