Exemple #1
0
 public static IApplicationBuilder UseMyMiddlewareWithParams(
     this IApplicationBuilder builder, MyMiddlewareOptions myMiddlewareOptions)
 {
     return(builder.UseMiddleware <MyMiddlewareWithParams>(
                new OptionsWrapper <MyMiddlewareOptions>(myMiddlewareOptions)));
 }
Exemple #2
0
 public MyMiddlewareWithParams(RequestDelegate next,
                               IOptions <MyMiddlewareOptions> optionsAccessor)
 {
     _next = next;
     _myMiddlewareOptions = optionsAccessor.Value;
 }