Пример #1
0
 //  Extension method for IApplicationBuilder to make using the middleware simpler.
 public static IApplicationBuilder UseJohan(this IApplicationBuilder app, JohanMiddlewareOptions options)
 {
     return(app.UseMiddleware <JohanMiddleware>(Options.Create(options)));
 }
Пример #2
0
 public JohanMiddleware(RequestDelegate next, IOptions <JohanMiddlewareOptions> options)
 {
     //  Cache the objects we need later on.
     _next    = next;
     _options = options.Value;
 }