// 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("/Home/Error"); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseCookiePolicy(); //Agregamos la configuracion Builder de la cultura CultureConfig.Configure(app); app.UseMvc(routes => { routes.MapRoute( name: "default", template: "{controller=Home}/{action=Index}/{id?}"); }); }
protected void Application_Start() { //ExtendedRazorViewEngine engine = new ExtendedRazorViewEngine(); //engine.AddViewLocationFormat("~/MyThemes/{1}/{0}.cshtml"); //ViewEngines.Engines.Add() CultureConfig.SetupCulture(); AreaRegistration.RegisterAllAreas(); RouteConfig.RegisterRoutes(RouteTable.Routes); //var gen = new DataGenerator(new PromosiDBModelContainer()); //gen.Generate(); }
// This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { services.Configure <CookiePolicyOptions>(options => { // This lambda determines whether user consent for non-essential cookies is needed for a given request. options.CheckConsentNeeded = context => true; options.MinimumSameSitePolicy = SameSiteMode.None; }); //Agregamos extension de la configuracion del servicio de la cultura. CultureConfig.ConfigureServices(services); //AddViewLocalization nos permite poder usar las culturas en las vistas razor services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2).AddDataAnnotationsLocalization().AddViewLocalization(LanguageViewLocationExpanderFormat.Suffix); }