示例#1
0
        public virtual void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            var httpContextAccessor = app.ApplicationServices.GetRequiredService <IHttpContextAccessor>();

            AcbHttpContext.Configure(httpContextAccessor);
            app.UseMvc();
        }
示例#2
0
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            var httpContextAccessor = app.ApplicationServices.GetRequiredService <IHttpContextAccessor>();

            AcbHttpContext.Configure(httpContextAccessor);
            app.UseMvc(routes => { routes.Routes.Add(new MicroServiceRouter()); });
        }
        /// <summary> 配置应用 </summary>
        /// <param name="app"></param>
        /// <param name="env"></param>
        /// <param name="loggerFactory"></param>
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
        {
            loggerFactory.AddConsole((p, l) => l >= LogLevel.Warning);
            var httpContextAccessor = app.ApplicationServices.GetRequiredService <IHttpContextAccessor>();

            AcbHttpContext.Configure(httpContextAccessor);
            app.UseMvc(routes =>
            {
                routes.Routes.Add(new MicroServiceRouter());
            });
        }