Anarchy/AnarchyMiddleware.cs
///<summary>
///Invoke method used by Middleware pipeline.
///</summary>
Invoke method used by Middleware pipeline.
Invoke method used by Middleware pipeline .
public async Task InvokeAsync(HttpContext context)
        {
            if (_config.Enabled())
            {
                var firstMatchingRoute = MatchingRoute(context.Request.Path.Value);
                if(firstMatchingRoute != null && Intercept(_config.CaptureRate)) {
                    context.Response.StatusCode = firstMatchingRoute.StatusCode;
                    await context.Response.WriteAsync(firstMatchingRoute.Response);
                }
                else {
                    await _next(context);
                }
            }
            else 
            {
                await _next(context);
            }
        }
public async Task InvokeAsync ( HttpContext context ) { if ( _config . Enabled ( ) ) { var firstMatchingRoute = MatchingRoute ( context . Request . Path . Value ) ; if ( firstMatchingRoute != null && Intercept ( _config . CaptureRate ) ) { context . Response . StatusCode = firstMatchingRoute . StatusCode ; await context . Response . WriteAsync ( firstMatchingRoute . Response ) ; } else { await _next ( context ) ; } } else { await _next ( context ) ; } }
Invoke method used by Middleware pipeline.
Invoke method used by Middleware pipeline .
context
HttpContext