/// <summary> /// Process an individual request. /// </summary> /// <param name="context"></param> /// <returns></returns> public Task Invoke(HttpContext context) { if (!_options.Path.HasValue || _options.Path == context.Request.Path) { var page = new DiagnosticsPage(); page.Execute(context); return(Task.FromResult(0)); } return(_next(context)); }
/// <summary> /// Process an individual request. /// </summary> /// <param name="environment"></param> /// <returns></returns> public Task Invoke(IDictionary <string, object> environment) { IOwinContext context = new OwinContext(environment); if (!_options.Path.HasValue || _options.Path == context.Request.Path) { var page = new DiagnosticsPage(); page.Execute(context); return(Task.FromResult(0)); } return(_next(environment)); }
/// <summary> /// Process an individual request. /// </summary> /// <param name="context"></param> /// <returns></returns> public override Task Invoke(IOwinContext context) { if (context == null) { throw new ArgumentNullException("context"); } if (!_options.Path.HasValue || _options.Path == context.Request.Path) { var page = new DiagnosticsPage(); page.Execute(context); return(CompletedTask()); } return(Next.Invoke(context)); }