public DebugMiddleware(AppFunc next, DebugMiddlewareOptions options) { if (null == next) { throw new ArgumentNullException("next"); } if (null == options) { throw new ArgumentNullException("options"); } _next = next; _options = options; if (_options.OnIncomingRequest == null) { _options.OnIncomingRequest = (ctx) => { System.Diagnostics.Debug.WriteLine("Incoming request: " + ctx.Request.Path); } } ; if (_options.OnOutgoingRequest == null) { _options.OnOutgoingRequest = (ctx) => { System.Diagnostics.Debug.WriteLine("Outgoing request: " + ctx.Request.Path); } } ; }
public static void UseDebugMiddleware(this IAppBuilder app, DebugMiddlewareOptions options = null) { if (options == null) { options = new DebugMiddlewareOptions(); } app.Use <DebugMiddleware>(options); }
public DebugMiddleware(AppFunc next, DebugMiddlewareOptions options) { if (null == next) throw new ArgumentNullException("next"); if (null == options) throw new ArgumentNullException("options"); _next = next; _options = options; if (_options.OnIncomingRequest == null) _options.OnIncomingRequest = (ctx) => { System.Diagnostics.Debug.WriteLine("Incoming request: " + ctx.Request.Path); }; if (_options.OnOutgoingRequest == null) _options.OnOutgoingRequest = (ctx) => { System.Diagnostics.Debug.WriteLine("Outgoing request: " + ctx.Request.Path); }; }