Пример #1
0
        public static IApplicationBuilder UseFailingMiddleware(this IApplicationBuilder builder, Action <FailingOptions> action)
        {
            var options = new FailingOptions();

            action?.Invoke(options);
            builder.UseMiddleware <FailingMiddleware>(options);
            return(builder);
        }
Пример #2
0
 public FailingMiddleware(RequestDelegate next, FailingOptions options)
 {
     _next     = next;
     _options  = options;
     _mustFail = false;
 }