public override void ConfigureServices(IServiceCollection services)
 {
     Console.WriteLine("start ConfigureServices");
     try
     {
         if (Convert.ToBoolean(GetLocalConfiguration("ShowProfiling")))
         {
             services.AddMiniProfiler(options =>
                                      options.RouteBasePath = "/profiler"
                                      );
         }
         // services.AddCors();
         this.ConfigureControllers(services);
         base.ConfigureServices(services);
         services.AddApplicationInsightsTelemetry();
         RegisterDataAccess.Register(services);
         RegisterBusinessService.Register(services);
         RegisterSwagger.Register(services);
     }
     catch (Exception ex)
     {
         Console.WriteLine("ConfigureServices ERROR:" + ex.ToString());
     }
     Console.WriteLine("end ConfigureServices");
 }
        public override void Configure(IApplicationBuilder app,
                                       IWebHostEnvironment env,
                                       IServiceProvider service,
                                       IHostApplicationLifetime applicationLifetime)
        {
            try
            {
                Console.WriteLine("start Configure");
                try
                {
                    var ShowProfiling = GetLocalConfiguration("ShowProfiling");
                    Console.WriteLine("Configure ShowProfiling :" + ShowProfiling);
                    if (Convert.ToBoolean(ShowProfiling))
                    {
                        app.UseMiniProfiler();
                    }
                }
                catch (Exception ex)
                {
                    Console.WriteLine("ShowProfiling ERROR:" + ex.ToString());
                }

                bool ShowOnlyCustomeAPIonUI = false;
                try
                {
                    var ShowOnlyCustomeAPIonUI1 = GetLocalConfiguration("ShowOnlyCustomeAPIonUI");
                    Console.WriteLine("Configure ShowOnlyCustomeAPIonUI1 :" + ShowOnlyCustomeAPIonUI1);
                    ShowOnlyCustomeAPIonUI = Convert.ToBoolean(ShowOnlyCustomeAPIonUI1);
                }
                catch (Exception ex)
                {
                    Console.WriteLine("Exception3 " + ex.ToString());
                }

                RegisterSwagger.UseSwagger(app, ShowOnlyCustomeAPIonUI);

                base.Configure(app, env, service, applicationLifetime);

                if (env.IsDevelopment())
                {
                    app.UseDeveloperExceptionPage();
                }
                else
                {
                    app.UseHsts();
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Configure ERROR:" + ex.ToString());
            }
            Console.WriteLine("end Configure");
        }