コード例 #1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IWebHostEnvironment env,
                              IControllerActivator controllerActivator, IActionActivator actionActivator, IConfiguration configuration)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseExceptionHandler("/Error");
                //app.UseHsts();
            }

            DataGateORM.Connect(configuration.GetConnectionString("postgres"));
            TableRegistry();

            app.UseSession();

            _routeHelper = new RouteHelper(controllerActivator, actionActivator);
            var routeBuilder = new RouteBuilder(app);

            _routeHelper.Initialize(routeBuilder);
            app.UseStaticFiles();
            app.UseStatusCodePagesWithReExecute("/Error/{0}");
            app.UseRouter(routeBuilder.Build());
        }
コード例 #2
0
 public ActionActivatorTest()
 {
     _fixture   = new Fixture();
     _activator = new ActionActivator();
     _thing     = new Thing();
     _service   = Substitute.For <IServiceProvider>();
 }
コード例 #3
0
 public RouteHelper(IControllerActivator controllerActivator, IActionActivator actionActivator)
 {
     _controllerActivator = controllerActivator;
     _actionActivator     = actionActivator;
     _actionDictionary    = new Dictionary <string, Dictionary <string, List <ActionEntity> > >();
 }
コード例 #4
0
 public RequestAction(ITargetBlock <Action> target, IActionActivator activator, IServiceProvider provider)
 {
     _target    = target;
     _activator = activator;
     _provider  = provider;
 }