Exemplo n.º 1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseSwagger();

            app.UseSwaggerUI(c =>
            {
                c.SwaggerEndpoint("/swagger/v1/swagger.json", "web api v1");
                //c.RoutePrefix = string.Empty;
            });
            app.UseMiddleware <TimeMiddleware>();
            // app.UseMiddleware<TimeMiddleware>(new StopWatch()); //也可以不把StopWatch添加到依赖注入容器中,而是在UserMiddleware方法中直接给出参数。
            app.UseMvc();
#if !DEBUG
            InitBLL.Start();
#endif
            InitBLL.Start();
            Task.Factory.StartNew(() => {
                TaoBaoKeHelper.ImportAllTaobaoke();
                TaoBaoKeHelper.ImportTaobaoke();
            });
        }
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);

            InitBLL.InitMapper();

            var bootstrapper = new Bootstrapper();

            bootstrapper.Run();
        }
Exemplo n.º 3
0
 public ResponseResult Get(string name)
 {
     InitBLL.Init();
     return(ResultStatus.Success);
 }