Beispiel #1
0
 public FailingMiddleware(RequestDelegate next, FailingOptions options, ILogger <FailingMiddleware> logger)
 {
     _next     = next;
     _options  = options;
     _logger   = logger;
     _mustFail = false;
 }
        public static IApplicationBuilder UseFailingMiddleware(this IApplicationBuilder builder, Action <FailingOptions> action)
        {
            var options = new FailingOptions();

            action?.Invoke(options);

            builder.UseMiddleware <FailingMiddleware>(options);
            return(builder);
        }