Ejemplo n.º 1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public async void Configure(IApplicationBuilder app, WorldContextSeedData seeder, ILoggerFactory logFactory)
        {
            logFactory.AddDebug(LogLevel.Information);
            app.UseStaticFiles();
            app.UseIdentity();

            Mapper.Initialize(conf =>
            {
                conf.CreateMap <Trip, TripModelView>().ReverseMap();
                conf.CreateMap <Stop, StopModelView>().ReverseMap();
            }       //createMap<src,dest>();
                              );

            app.UseCookieAuthentication(opt =>
            {
                opt.LoginPath = new PathString("/Account/Login");
            });


            app.UseMvc(config =>
            {
                config.MapRoute(
                    name: "Default",
                    template: "{controller}/{action}/{id?}",
                    defaults: new { controller = "App", action = "Index" }
                    );
            });

            await seeder.EnsureDataWithAsync();

            //app.UseIISPlatformHandler();

            //app.Run(async (context) =>
            //{
            //    await context.Response.WriteAsync("Hello World!");
            //});
        }