Пример #1
0
        // Configure is called after ConfigureServices is called.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
        {
            // Configure the HTTP request pipeline.
            app.UseStaticFiles();

            // Add MVC to the request pipeline.
            app.UseMvc();

            //add basic logging
            loggerFactory.MinimumLevel = LogLevel.Information;
            loggerFactory.AddConsole();



            //Add Sample Data to Elastic Search
            var service = app.ApplicationServices.GetService <IConfigurationElasticClientSettings>();
            var helper  = new ElasticSearchDataHelper(service, loggerFactory);

            helper.AddTestData().Wait();
        }
Пример #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, ILoggerFactory loggerFactory)
        {
            loggerFactory.AddConsole(Configuration.GetSection("Logging"));
            loggerFactory.AddDebug();

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                app.UseBrowserLink();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
            }

            app.UseStaticFiles();

            app.UseMvc();

            var service = app.ApplicationServices.GetService <IConfigurationElasticClientSettings>();
            var helper  = new ElasticSearchDataHelper(service, loggerFactory);

            helper.AddTestData().Wait();
        }