Пример #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();
             * }
             * else {
             *      app.UseExceptionHandler("/Error");
             * }
             */

            // Get configuration
            //IConfiguration config = app.ApplicationServices.GetService<IConfiguration>();

            // Configure connections
            IConnections connections = app.ApplicationServices.GetService <IConnections>();

            connections.Configure(this.Configuration.GetSection("Connections"));

            // Configure entity manager
            IEntityManager em = app.ApplicationServices.GetService <IEntityManager>();

            EntityManager.setInstance(em);
            //em.setConnections(connections);

            app.UseStatusCodePagesWithReExecute("/error/{0}");
            app.UseDeveloperExceptionPage();
            app.UseStaticFiles();
            app.UseMvc();
        }