public void ConfigureMiddleware(MiddlewareBuilder builder) { builder.Use <Middleware1>() .Use <StaticFilesMiddleware>() .Use <AuthMiddleware>() .Use <MvcMiddleware>(); }
public MyWebServer Configure <T>() where T : IConfigurator, new() { IConfigurator configurator = new T(); MiddlewareBuilder middlewareBuilder = new MiddlewareBuilder(); configurator.ConfigureMiddleware(middlewareBuilder); firstMiddleware = middlewareBuilder.Build(); ContainerBuilder containerBuilder = new ContainerBuilder(); //builder.RegisterSource(new AnyConcreteTypeNotAlreadyRegisteredSource()); configurator.ConfigureServices(containerBuilder); Services = containerBuilder.Build(); return(this); }