public void Configuration(IAppBuilder app) { app.UseLogging(); app.UseAuthentication(); var options = new MyMiddlewareConfigOptions("Greetings!", "Kevin"); options.IncludeDate = true; app.UseMyMiddelware(options); //app.UseMyOtherMiddleware(); }
public MyMiddlewareComponent(AppFunc next, MyMiddlewareConfigOptions configOptions) { this.next = next; this.configOptions = configOptions; }
public static void UseMyMiddelware(this IAppBuilder app, MyMiddlewareConfigOptions options) { app.Use<MyMiddlewareComponent>(options); }