public static IApplicationBuilder UseFailingMiddleware(this IApplicationBuilder builder, Action <FailingOptions> action)
        {
            var options = new FailingOptions();

            action?.Invoke(options);
            builder.UseMiddleware <FailingMiddleware>(options);
            return(builder);
        }
Exemplo n.º 2
0
 public FailingMiddleware(RequestDelegate next, FailingOptions options)
 {
     _next     = next;
     _options  = options;
     _mustFail = false;
 }