コード例 #1
0
 private async Task <JObject> CreateResponse(string command, JObject reqParams, bool fixedParam = false)
 {
     if (command.Equals("*Refresh"))
     {
         RefBook.Refresh(_context);
         return(await Task.Run(() => DoRefreshCommand()));
     }
     else
     {
         return(await DoCommand(command, reqParams, fixedParam));
     }
 }
コード例 #2
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();
            }
            else
            {
                app.UseHsts();
            }

            app.UseHttpsRedirection();
            app.ConfigureExceptionHandler();
            app.UseMiddleware <BasicAuthMiddleware>();
            //app.UseMiddleware<ExceptionHandler>();
            using (var serviceScope = app.ApplicationServices.CreateScope())
            {
                var         services  = serviceScope.ServiceProvider;
                MainContext dbContext = services.GetService <MainContext>();
                RefBook.Refresh(dbContext);
            }
            app.UseMvc();
        }
コード例 #3
0
 private JObject DoRefreshCommand()
 {
     RefBook.Refresh(_context);
     return(new JObject());
 }