Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void Configure(IApplicationBuilder app, IHostingEnvironment env)
- {
- app.UseAuthentication();
- var locOptions =
- app.ApplicationServices.GetService<IOptions<RequestLocalizationOptions>>();
- app.UseRequestLocalization(locOptions.Value);
- CultureInfo cultureInfo = Thread.CurrentThread.CurrentCulture;
- var culture = cultureInfo.Name;
- if (env.IsDevelopment())
- {
- app.UseDeveloperExceptionPage();
- }
- app.UseStaticFiles();
- app.UseSession();
- //configuring mvc routes...
- app.UseMvc(routes =>
- {
- routes.MapRoute(
- name: "areaRoute",
- template: "{area:exists}/{controller}/{action}/{id?}",
- defaults: new { controller = "Home", action = "Index" });
- routes.MapRoute(
- name: "default",
- template: "{culture}/{controller}/{action}/{id?}",
- defaults: new { culture = culture, controller = "Home", action = "Index" });
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement