Esempio 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, DataContext context)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseCors();

            //StaticFile Allowance Initialized
            app.UseStaticFiles();

            app.UseAuthentication();

            app.UseMvc();

            //Mapping Initialized
            Mapper.Initialize(cfg =>
            {
                MapUtility.ConfigureMapping(cfg);
            });

            BuildAppSettings();

            if (bool.TryParse(Configuration["AppSettings:Migration:DbSeed"], out var seed) && seed)
            {
                DbInitializer.Seed(context);
            }
        }