コード例 #1
0
 public void ConfigureMiddleware(MiddlewareBuilder builder)
 {
     builder.Use <Middleware1>()
     .Use <StaticFilesMiddleware>()
     .Use <AuthMiddleware>()
     .Use <MvcMiddleware>();
 }
コード例 #2
0
        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);
        }